0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/free_mon/free_mon_metrics_perm_del.js
2018-04-20 12:38:28 -04:00

32 lines
774 B
JavaScript

// Ensure free monitoring gives up if metrics returns permanently delete
//
load("jstests/free_mon/libs/free_mon.js");
(function() {
'use strict';
let mock_web = new FreeMonWebServer(FAULT_PERMANENTLY_DELETE_AFTER_3);
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(4);
// Make sure the registration document gets removed
const reg = FreeMonGetRegistration(conn);
print(tojson(reg));
assert.eq(reg, undefined);
MongoRunner.stopMongod(conn);
mock_web.stop();
})();