mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
32 lines
741 B
JavaScript
32 lines
741 B
JavaScript
// Ensure free monitoring gives up if metrics returns halt
|
|
//
|
|
load("jstests/free_mon/libs/free_mon.js");
|
|
|
|
(function() {
|
|
'use strict';
|
|
|
|
let mock_web = new FreeMonWebServer(FAULT_HALT_METRICS_5);
|
|
|
|
mock_web.start();
|
|
|
|
let options = {
|
|
setParameter: "cloudFreeMonitoringEndpointURL=" + mock_web.getURL(),
|
|
enableFreeMonitoring: "on",
|
|
verbose: 1,
|
|
};
|
|
|
|
const conn = MongoRunner.runMongod(options);
|
|
assert.neq(null, conn, 'mongod was unable to start up');
|
|
|
|
mock_web.waitMetrics(6);
|
|
|
|
// It gets marked as disabled on halt
|
|
const reg = FreeMonGetRegistration(conn);
|
|
print(tojson(reg));
|
|
assert.eq(reg.state, "disabled");
|
|
|
|
MongoRunner.stopMongod(conn);
|
|
|
|
mock_web.stop();
|
|
})();
|