2018-04-20 17:59:06 +02:00
|
|
|
// Ensure free monitoring gives up if metrics returns halt
|
|
|
|
//
|
|
|
|
load("jstests/free_mon/libs/free_mon.js");
|
|
|
|
|
|
|
|
(function() {
|
2019-07-27 00:20:35 +02:00
|
|
|
'use strict';
|
2018-04-20 17:59:06 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
let mock_web = new FreeMonWebServer(FAULT_HALT_METRICS_5);
|
2018-04-20 17:59:06 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
mock_web.start();
|
2018-04-20 17:59:06 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
let options = {
|
|
|
|
setParameter: "cloudFreeMonitoringEndpointURL=" + mock_web.getURL(),
|
|
|
|
enableFreeMonitoring: "on",
|
|
|
|
verbose: 1,
|
|
|
|
};
|
2018-04-20 17:59:06 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
const conn = MongoRunner.runMongod(options);
|
|
|
|
assert.neq(null, conn, 'mongod was unable to start up');
|
2018-04-20 17:59:06 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
mock_web.waitMetrics(6);
|
2018-04-20 17:59:06 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
// It gets marked as disabled on halt
|
|
|
|
const reg = FreeMonGetRegistration(conn);
|
|
|
|
print(tojson(reg));
|
|
|
|
assert.eq(reg.state, "disabled");
|
2018-04-20 17:59:06 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
MongoRunner.stopMongod(conn);
|
2018-04-20 17:59:06 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
mock_web.stop();
|
2018-04-20 17:59:06 +02:00
|
|
|
})();
|