mikhail-angelov / mongo-unit

MIT License
72 stars 39 forks source link

Does not work on gitlab-ci anymore #37

Closed mebibou closed 4 years ago

mebibou commented 4 years ago

I was using the master version of mongo-unit a while back and for the past 2 weeks my tests are stalling on gitlab, after putting some logs I can see it blocks here:

// prepare.ts
const url = await mongoUnit.start();
bearzk commented 4 years ago

I have the same problem on codeship with version 1.5.x and 2.0.0.

all tests run fine on my local MacOS.

the important part of init.js looks like this:

console.log('initialize in memory mongo with mongo unit');
mongoUnit.start({ port: mongoPort, verbose: true }).then((url) => {
  console.log('in memory mongo is started: ', url);
  run();
});

I can see the first console.log output, but not the second.

when the verbose option is toggled on, I see logs like following, but no more output, just hangs there, any idea what could be the problem?

mongodb-prebuilt-MongoDBPrebuilt getHomeDirectory(): /home/rof/.mongodb-prebuilt +0ms
  mongodb-download-MongoDBDownload createDownloadDir(): /home/rof/.mongodb-prebuilt/mongodb-download +0ms
  mongodb-download-MongoDBDownload createDownloadDir(): true +2ms
  mongodb-download-MongoDBDownload getDownloadURI (url obj returned with href): https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-latest.tgz +7ms
  mongodb-download-MongoDBDownload getHttpOptions {
  protocol: 'https:',
  hostname: 'fastdl.mongodb.org',
  path: '/linux/mongodb-linux-x86_64-ubuntu1804-latest.tgz'
} +0ms
  mongodb-download-MongoDBDownload getDownloadLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz +1ms
  mongodb-download-MongoDBDownload getTempDownloadLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz.downloading +1ms
  mongodb-download-MongoDBDownload getDownloadLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz +0ms
  mongodb-download-MongoDBDownload sending file from cache /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz +1ms
  mongodb-download-MongoDBDownload getDownloadLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz +0ms
  mongodb-download-MongoDBDownload @getMD5HashFileLocation resolving md5HashLocation: /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz.md5 +0ms
  mongodb-download-MongoDBDownload @getMD5Hash resolving offlineSignature 01c59667efac1cceba829a7f0eb1b043 +1ms
  mongodb-download-MongoDBDownload isDownloadPresent() md5 match: true +442ms
  mongodb-download-MongoDBDownload download(): /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz +1ms
  mongodb-download-MongoDBDownload getDownloadLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz +0ms
  mongodb-download-MongoDBDownload @getMD5HashFileLocation resolving md5HashLocation: /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz.md5 +0ms
  mongodb-download-MongoDBDownload @getMD5Hash resolving offlineSignature 01c59667efac1cceba829a7f0eb1b043 +2ms
  mongodb-download-MongoDBDownload getExtractLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/01c59667efac1cceba829a7f0eb1b043 +0ms
  mongodb-download-MongoDBDownload getDownloadLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz +0ms
  mongodb-download-MongoDBDownload @getMD5HashFileLocation resolving md5HashLocation: /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz.md5 +0ms
  mongodb-download-MongoDBDownload @getMD5Hash resolving offlineSignature 01c59667efac1cceba829a7f0eb1b043 +1ms
  mongodb-download-MongoDBDownload getDownloadLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz +0ms
  mongodb-download-MongoDBDownload @getMD5HashFileLocation resolving md5HashLocation: /home/rof/.mongodb-prebuilt/mongodb-download/mongodb-linux-x86_64-ubuntu1804-latest.tgz.md5 +0ms
  mongodb-download-MongoDBDownload @getMD5Hash resolving offlineSignature 01c59667efac1cceba829a7f0eb1b043 +0ms
  mongodb-download-MongoDBDownload getExtractLocation(): /home/rof/.mongodb-prebuilt/mongodb-download/01c59667efac1cceba829a7f0eb1b043 +0ms
  mongodb-download-MongoDBDownload sending file from cache /home/rof/.mongodb-prebuilt/mongodb-download/01c59667efac1cceba829a7f0eb1b043 +1ms
  mongodb-download-MongoDBDownload isExtractPresent(): true +0ms
  mongodb-prebuilt-MongoDBPrebuilt resolveBinPath(): /home/rof/.mongodb-prebuilt/mongodb-download/01c59667efac1cceba829a7f0eb1b043/mongodb-linux-x86_64-ubuntu1804-4.5.0-341-g8f32ba7/bin +471ms
  mongodb-prebuilt-MongoBins getCommand(): /home/rof/.mongodb-prebuilt/mongodb-download/01c59667efac1cceba829a7f0eb1b043/mongodb-linux-x86_64-ubuntu1804-4.5.0-341-g8f32ba7/bin/mongod +0ms
  mongodb-prebuilt-MongoSupervice isWindows(): false +10ms
  mongodb-prebuilt-MongoSupervice runOnLinux() +0ms
  mongodb-prebuilt-MongoSupervice getSuperviseCommand(): /home/rof/src/github.com/alyne/library-store/node_modules/mongodb-prebuilt/built/bin/mongo-supervise.js +1ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.444+00:00"},"s":"I", "c":"CONTROL", "id":23285,"ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
  mongodb-prebuilt-MongodHelper  +56ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.447+00:00"},"s":"W", "c":"ASIO",    "id":22601,"ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
  mongodb-prebuilt-MongodHelper  +2ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.447+00:00"},"s":"I", "c":"NETWORK", "id":4648601,"ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
  mongodb-prebuilt-MongodHelper  +0ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.447+00:00"},"s":"I", "c":"STORAGE", "id":4615611,"ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":12602,"port":54808,"dbpath":"/home/rof/src/github.com/alyne/library-store/node_modules/mongo-unit/.mongo-unit","architecture":"64-bit","host":"bionic_32ef0f59-24e2-4b3b-ac88-48f7a951c5b0_21e78f85a541"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.447+00:00"},"s":"I", "c":"CONTROL", "id":23403,"ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.5.0-341-g8f32ba7","gitVersion":"8f32ba76afa83456e47aefe683ce55b3da0dbdae","openSSLVersion":"OpenSSL 1.1.1  11 Sep 2018","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu1804","distarch":"x86_64","target_arch":"x86_64"}}}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.447+00:00"},"s":"I", "c":"CONTROL", "id":51765,"ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"18.04"}}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.447+00:00"},"s":"I", "c":"CONTROL", "id":21951,"ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"port":54808},"storage":{"dbPath":"/home/rof/src/github.com/alyne/library-store/node_modules/mongo-unit/.mongo-unit","engine":"ephemeralForTest"}}}}
  mongodb-prebuilt-MongodHelper  +1ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.450+00:00"},"s":"W", "c":"CONTROL", "id":22117,"ctx":"initandlisten","msg":"This is a development version of MongoDB. Not recommended for production.","attr":{"version":"4.5.0-341-g8f32ba7"},"tags":["startupWarnings"]}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.450+00:00"},"s":"W", "c":"CONTROL", "id":22120,"ctx":"initandlisten","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted.","tags":["startupWarnings"]}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.450+00:00"},"s":"W", "c":"CONTROL", "id":22140,"ctx":"initandlisten","msg":"This server is bound to localhost. Remote systems will be unable to connect to this server. Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. If this behavior is desired, start the server with --bind_ip 127.0.0.1 to disable this warning.","tags":["startupWarnings"]}
  mongodb-prebuilt-MongodHelper  +2ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.450+00:00"},"s":"W", "c":"CONTROL", "id":22184,"ctx":"initandlisten","msg":"soft rlimits too low.","attr":{"currentValue":8192,"recommendedMinimum":64000},"tags":["startupWarnings"]}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.450+00:00"},"s":"I", "c":"CONTROL", "id":22197,"ctx":"initandlisten","msg":"The ephemeralForTest storage engine is for testing only. Do not use in production.","tags":["startupWarnings"]}
  mongodb-prebuilt-MongodHelper  +0ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.450+00:00"},"s":"I", "c":"STORAGE", "id":20320,"ctx":"initandlisten","msg":"createCollection: {nss} with {generatedUUID_generated_provided} UUID: {optionsWithUUID_uuid_get} and options: {options}","attr":{"nss":"admin.system.version","generatedUUID_generated_provided":"provided","optionsWithUUID_uuid_get":{"uuid":{"$uuid":"506be159-4361-402e-842c-d42ba54e276c"}},"options":{"uuid":{"$uuid":"506be159-4361-402e-842c-d42ba54e276c"}}}}
  mongodb-prebuilt-MongodHelper  +1ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.451+00:00"},"s":"I", "c":"INDEX",   "id":20345,"ctx":"initandlisten","msg":"index build: done building index {indexName} on ns {nss}","attr":{"indexName":"_id_","nss":"admin.system.version"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.451+00:00"},"s":"I", "c":"COMMAND", "id":20459,"ctx":"initandlisten","msg":"setting featureCompatibilityVersion to {FeatureCompatibilityVersionParser_newVersion}","attr":{"FeatureCompatibilityVersionParser_newVersion":"4.4"}}
  mongodb-prebuilt-MongodHelper  +0ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.451+00:00"},"s":"I", "c":"STORAGE", "id":20536,"ctx":"initandlisten","msg":"Flow Control is enabled on this deployment."}
  mongodb-prebuilt-MongodHelper  +0ms
  mongodb-prebuilt-MongodHelper mongod stdout: {"t":{"$date":"2020-03-24T19:28:42.454+00:00"},"s":"I", "c":"STORAGE", "id":20320,"ctx":"initandlisten","msg":"createCollection: {nss} with {generatedUUID_generated_provided} UUID: {optionsWithUUID_uuid_get} and options: {options}","attr":{"nss":"local.startup_log","generatedUUID_generated_provided":"generated","optionsWithUUID_uuid_get":{"uuid":{"$uuid":"b20c7bed-4f86-4bdd-ac7a-25c420a8151e"}},"options":{"capped":true,"size":10485760}}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.454+00:00"},"s":"I", "c":"INDEX",   "id":20345,"ctx":"initandlisten","msg":"index build: done building index {indexName} on ns {nss}","attr":{"indexName":"_id_","nss":"local.startup_log"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.454+00:00"},"s":"I", "c":"FTDC",    "id":20625,"ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/home/rof/src/github.com/alyne/library-store/node_modules/mongo-unit/.mongo-unit/diagnostic.data"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.456+00:00"},"s":"I", "c":"CONTROL", "id":20712,"ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.456+00:00"},"s":"I", "c":"STORAGE", "id":20320,"ctx":"LogicalSessionCacheRefresh","msg":"createCollection: {nss} with {generatedUUID_generated_provided} UUID: {optionsWithUUID_uuid_get} and options: {options}","attr":{"nss":"config.system.sessions","generatedUUID_generated_provided":"generated","optionsWithUUID_uuid_get":{"uuid":{"$uuid":"2b72e650-7c01-4919-ae5f-01550d8d7bf8"}},"options":{}}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.456+00:00"},"s":"I", "c":"NETWORK", "id":23015,"ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-54808.sock"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.456+00:00"},"s":"I", "c":"NETWORK", "id":23015,"ctx":"listener","msg":"Listening on","attr":{"address":"127.0.0.1"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.456+00:00"},"s":"I", "c":"NETWORK", "id":23016,"ctx":"listener","msg":"Waiting for connections","attr":{"port":54808,"ssl":"off"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.456+00:00"},"s":"I", "c":"INDEX",   "id":20345,"ctx":"LogicalSessionCacheRefresh","msg":"index build: done building index {indexName} on ns {nss}","attr":{"indexName":"_id_","nss":"config.system.sessions"}}
  mongodb-prebuilt-MongodHelper {"t":{"$date":"2020-03-24T19:28:42.457+00:00"},"s":"I", "c":"INDEX",   "id":20345,"ctx":"LogicalSessionCacheRefresh","msg":"index build: done building index {indexName} on ns {nss}","attr":{"indexName":"lsidTTLIndex","nss":"config.system.sessions"}}
  mongodb-prebuilt-MongodHelper  +7ms
bearzk commented 4 years ago

the current master 2.0.0 is also failing on circle.

for anyone comes later and have problem as well, I tried again in docker with the circleci/node:10 image, on which the testsuite of this package also runs. please check .circleci folder.

when running the tests in this container, with export MONGOMS_DEBUG=1, got messages like this

mongo-unit
starting in mem mongo
  MongoMS:MongoMemoryServer Called MongoMemoryServer.start() method +0ms
  MongoMS:MongoMemoryServer Starting MongoDB instance with following options: {"port":27017,"dbName":"test","ip":"127.0.0.1","storageEngine":"ephemeralForTest","dbPath":"/code/mongo-unit/.mongo-unit","uri":"mongodb://127.0.0.1:27017/test?"} +2ms
  MongoMS:MongoBinary MongoBinary options: {"downloadDir":"/code/mongo-unit/node_modules/.cache/mongodb-memory-server/mongodb-binaries","platform":"linux","arch":"x64","version":"latest"} +0ms
  MongoMS:MongoMemoryServer Called MongoMemoryServer.start() method +4ms
  MongoMS:MongoMemoryServer starting with port 41955, since 27017 was locked: 41955 +0ms
  MongoMS:MongoMemoryServer Starting MongoDB instance with following options: {"port":41955,"dbName":"test","ip":"127.0.0.1","storageEngine":"ephemeralForTest","dbPath":"/code/mongo-unit/.mongo-unit","uri":"mongodb://127.0.0.1:41955/test?"} +1ms
  MongoMS:MongoBinary MongoBinary options: {"downloadDir":"/code/mongo-unit/node_modules/.cache/mongodb-memory-server/mongodb-binaries","platform":"linux","arch":"x64","version":"latest"} +3ms
  MongoMS:MongoBinary MongoBinary: Mongod binary path: /code/mongo-unit/node_modules/.cache/mongodb-memory-server/mongodb-binaries/latest/mongod +4ms
  MongoMS:MongoInstance Mongo[27017]: Called MongoInstance._launchKiller(parent: 47, child: 60): +0ms
  MongoMS:MongoBinary MongoBinary: Download lock removed +10ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.642+00:00"},"s":"I", "c":"CONTROL", "id":23285,"ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
  MongoMS:MongoInstance  +25ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.645+00:00"},"s":"W", "c":"ASIO",    "id":22601,"ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
  MongoMS:MongoInstance  +2ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.645+00:00"},"s":"I", "c":"NETWORK", "id":4648601,"ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.646+00:00"},"s":"I", "c":"STORAGE", "id":4615611,"ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":60,"port":27017,"dbpath":"/code/mongo-unit/.mongo-unit","architecture":"64-bit","host":"ad423b140f46"}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.646+00:00"},"s":"I", "c":"CONTROL", "id":23403,"ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.5.0-341-g8f32ba7","gitVersion":"8f32ba76afa83456e47aefe683ce55b3da0dbdae","openSSLVersion":"OpenSSL 1.1.0l  10 Sep 2019","modules":[],"allocator":"tcmalloc","environment":{"distmod":"debian92","distarch":"x86_64","target_arch":"x86_64"}}}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.646+00:00"},"s":"I", "c":"CONTROL", "id":51765,"ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"PRETTY_NAME=\"Debian GNU/Linux 9 (stretch)\"","version":"Kernel 4.19.76-linuxkit"}}}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.646+00:00"},"s":"I", "c":"CONTROL", "id":21951,"ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"127.0.0.1","port":27017},"security":{"authorization":"disabled"},"storage":{"dbPath":"/code/mongo-unit/.mongo-unit","engine":"ephemeralForTest"}}}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.652+00:00"},"s":"W", "c":"CONTROL", "id":22117,"ctx":"initandlisten","msg":"This is a development version of MongoDB. Not recommended for production.","attr":{"version":"4.5.0-341-g8f32ba7"},"tags":["startupWarnings"]}
  MongoMS:MongoInstance  +5ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.652+00:00"},"s":"I", "c":"CONTROL", "id":22197,"ctx":"initandlisten","msg":"The ephemeralForTest storage engine is for testing only. Do not use in production.","tags":["startupWarnings"]}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.653+00:00"},"s":"I", "c":"STORAGE", "id":20320,"ctx":"initandlisten","msg":"createCollection: {nss} with {generatedUUID_generated_provided} UUID: {optionsWithUUID_uuid_get} and options: {options}","attr":{"nss":"admin.system.version","generatedUUID_generated_provided":"provided","optionsWithUUID_uuid_get":{"uuid":{"$uuid":"19a73004-30aa-4fcd-bf8a-f7692127cf4d"}},"options":{"uuid":{"$uuid":"19a73004-30aa-4fcd-bf8a-f7692127cf4d"}}}}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.654+00:00"},"s":"I", "c":"INDEX",   "id":20345,"ctx":"initandlisten","msg":"index build: done building index {indexName} on ns {nss}","attr":{"indexName":"_id_","nss":"admin.system.version"}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.654+00:00"},"s":"I", "c":"COMMAND", "id":20459,"ctx":"initandlisten","msg":"setting featureCompatibilityVersion to {FeatureCompatibilityVersionParser_newVersion}","attr":{"FeatureCompatibilityVersionParser_newVersion":"4.4"}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.654+00:00"},"s":"I", "c":"STORAGE", "id":20536,"ctx":"initandlisten","msg":"Flow Control is enabled on this deployment."}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.655+00:00"},"s":"I", "c":"STORAGE", "id":20320,"ctx":"initandlisten","msg":"createCollection: {nss} with {generatedUUID_generated_provided} UUID: {optionsWithUUID_uuid_get} and options: {options}","attr":{"nss":"local.startup_log","generatedUUID_generated_provided":"generated","optionsWithUUID_uuid_get":{"uuid":{"$uuid":"502e8cf1-de93-4e68-8677-b9f013a632ed"}},"options":{"capped":true,"size":10485760}}}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.655+00:00"},"s":"I", "c":"INDEX",   "id":20345,"ctx":"initandlisten","msg":"index build: done building index {indexName} on ns {nss}","attr":{"indexName":"_id_","nss":"local.startup_log"}}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.656+00:00"},"s":"I", "c":"FTDC",    "id":20625,"ctx":"initandlisten","msg":"Initializing full-time diagnostic data capture","attr":{"dataDirectory":"/code/mongo-unit/.mongo-unit/diagnostic.data"}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.658+00:00"},"s":"I", "c":"STORAGE", "id":20320,"ctx":"LogicalSessionCacheRefresh","msg":"createCollection: {nss} with {generatedUUID_generated_provided} UUID: {optionsWithUUID_uuid_get} and options: {options}","attr":{"nss":"config.system.sessions","generatedUUID_generated_provided":"generated","optionsWithUUID_uuid_get":{"uuid":{"$uuid":"16159f53-b59e-4e79-823f-0b5814416868"}},"options":{}}}
  MongoMS:MongoInstance  +2ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.658+00:00"},"s":"I", "c":"INDEX",   "id":20345,"ctx":"LogicalSessionCacheRefresh","msg":"index build: done building index {indexName} on ns {nss}","attr":{"indexName":"_id_","nss":"config.system.sessions"}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.658+00:00"},"s":"I", "c":"INDEX",   "id":20345,"ctx":"LogicalSessionCacheRefresh","msg":"index build: done building index {indexName} on ns {nss}","attr":{"indexName":"lsidTTLIndex","nss":"config.system.sessions"}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.658+00:00"},"s":"I", "c":"NETWORK", "id":23015,"ctx":"listener","msg":"Listening on","attr":{"address":"/tmp/mongodb-27017.sock"}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.658+00:00"},"s":"I", "c":"NETWORK", "id":23015,"ctx":"listener","msg":"Listening on","attr":{"address":"127.0.0.1"}}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[27017]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.658+00:00"},"s":"I", "c":"NETWORK", "id":23016,"ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoBinary MongoBinary: Mongod binary path: /code/mongo-unit/node_modules/.cache/mongodb-memory-server/mongodb-binaries/latest/mongod +94ms
  MongoMS:MongoInstance Mongo[41955]: Called MongoInstance._launchKiller(parent: 47, child: 87): +64ms
  MongoMS:MongoBinary MongoBinary: Download lock removed +13ms
  MongoMS:MongoInstance Mongo[41955]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.743+00:00"},"s":"I", "c":"CONTROL", "id":23285,"ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
  MongoMS:MongoInstance  +20ms
  MongoMS:MongoInstance Mongo[41955]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.748+00:00"},"s":"W", "c":"ASIO",    "id":22601,"ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
  MongoMS:MongoInstance  +5ms
  MongoMS:MongoInstance Mongo[41955]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.748+00:00"},"s":"I", "c":"NETWORK", "id":4648601,"ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[41955]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.749+00:00"},"s":"I", "c":"STORAGE", "id":4615611,"ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":87,"port":41955,"dbpath":"/code/mongo-unit/.mongo-unit","architecture":"64-bit","host":"ad423b140f46"}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.749+00:00"},"s":"I", "c":"CONTROL", "id":23403,"ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.5.0-341-g8f32ba7","gitVersion":"8f32ba76afa83456e47aefe683ce55b3da0dbdae","openSSLVersion":"OpenSSL 1.1.0l  10 Sep 2019","modules":[],"allocator":"tcmalloc","environment":{"distmod":"debian92","distarch":"x86_64","target_arch":"x86_64"}}}}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[41955]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.749+00:00"},"s":"I", "c":"CONTROL", "id":51765,"ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"PRETTY_NAME=\"Debian GNU/Linux 9 (stretch)\"","version":"Kernel 4.19.76-linuxkit"}}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.749+00:00"},"s":"I", "c":"CONTROL", "id":21951,"ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"127.0.0.1","port":41955},"security":{"authorization":"disabled"},"storage":{"dbPath":"/code/mongo-unit/.mongo-unit","engine":"ephemeralForTest"}}}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[41955]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.753+00:00"},"s":"I", "c":"STORAGE", "id":20557,"ctx":"initandlisten","msg":"exception in initAndListen: {e}, terminating","attr":{"e":"DBPathInUse: Unable to lock the lock file: /code/mongo-unit/.mongo-unit/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /code/mongo-unit/.mongo-unit directory"}}
  MongoMS:MongoInstance  +4ms
  MongoMS:MongoInstance Mongo[41955]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.753+00:00"},"s":"I", "c":"NETWORK", "id":20562,"ctx":"initandlisten","msg":"shutdown: going to close listening sockets..."}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.753+00:00"},"s":"I", "c":"-",       "id":20520,"ctx":"initandlisten","msg":"Stopping further Flow Control ticket acquisitions."}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.753+00:00"},"s":"I", "c":"CONTROL", "id":20565,"ctx":"initandlisten","msg":"now exiting"}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.753+00:00"},"s":"I", "c":"CONTROL", "id":23138,"ctx":"initandlisten","msg":"shutting down with code:{code}","attr":{"code":100}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[41955]: MongodbInstance: is failed: Mongod shutting down +0ms
  MongoMS:MongoMemoryServer Mongodb did not start. Trying to start on another port one more time... +145ms
  MongoMS:MongoMemoryServer Starting MongoDB instance with following options: {"port":38625,"dbName":"test","ip":"127.0.0.1","storageEngine":"ephemeralForTest","dbPath":"/code/mongo-unit/.mongo-unit","uri":"mongodb://127.0.0.1:38625/test?"} +1ms
  MongoMS:MongoBinary MongoBinary options: {"downloadDir":"/code/mongo-unit/node_modules/.cache/mongodb-memory-server/mongodb-binaries","platform":"linux","arch":"x64","version":"latest"} +25ms
  MongoMS:MongoBinary MongoBinary: Mongod binary path: /code/mongo-unit/node_modules/.cache/mongodb-memory-server/mongodb-binaries/latest/mongod +0ms
  MongoMS:MongoInstance Mongo[38625]: Called MongoInstance._launchKiller(parent: 47, child: 99): +7ms
  MongoMS:MongoInstance Mongo[41955]: [MongoKiller]: exit - [null,"SIGTERM"] +5ms
  MongoMS:MongoInstance Mongo[41955]: CLOSE: 100 +0ms
  MongoMS:MongoInstance Mongo[38625]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.782+00:00"},"s":"I", "c":"CONTROL", "id":23285,"ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
  MongoMS:MongoInstance  +17ms
  MongoMS:MongoInstance Mongo[38625]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.784+00:00"},"s":"W", "c":"ASIO",    "id":22601,"ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
  MongoMS:MongoInstance  +2ms
  MongoMS:MongoInstance Mongo[38625]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.784+00:00"},"s":"I", "c":"NETWORK", "id":4648601,"ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[38625]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.785+00:00"},"s":"I", "c":"STORAGE", "id":4615611,"ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":99,"port":38625,"dbpath":"/code/mongo-unit/.mongo-unit","architecture":"64-bit","host":"ad423b140f46"}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.785+00:00"},"s":"I", "c":"CONTROL", "id":23403,"ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.5.0-341-g8f32ba7","gitVersion":"8f32ba76afa83456e47aefe683ce55b3da0dbdae","openSSLVersion":"OpenSSL 1.1.0l  10 Sep 2019","modules":[],"allocator":"tcmalloc","environment":{"distmod":"debian92","distarch":"x86_64","target_arch":"x86_64"}}}}
  MongoMS:MongoInstance  +1ms
  MongoMS:MongoInstance Mongo[38625]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.785+00:00"},"s":"I", "c":"CONTROL", "id":51765,"ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"PRETTY_NAME=\"Debian GNU/Linux 9 (stretch)\"","version":"Kernel 4.19.76-linuxkit"}}}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.785+00:00"},"s":"I", "c":"CONTROL", "id":21951,"ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"127.0.0.1","port":38625},"security":{"authorization":"disabled"},"storage":{"dbPath":"/code/mongo-unit/.mongo-unit","engine":"ephemeralForTest"}}}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[38625]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.789+00:00"},"s":"I", "c":"STORAGE", "id":20557,"ctx":"initandlisten","msg":"exception in initAndListen: {e}, terminating","attr":{"e":"DBPathInUse: Unable to lock the lock file: /code/mongo-unit/.mongo-unit/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /code/mongo-unit/.mongo-unit directory"}}
  MongoMS:MongoInstance  +4ms
  MongoMS:MongoInstance Mongo[38625]: STDOUT: {"t":{"$date":"2020-03-24T21:56:47.789+00:00"},"s":"I", "c":"NETWORK", "id":20562,"ctx":"initandlisten","msg":"shutdown: going to close listening sockets..."}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.789+00:00"},"s":"I", "c":"-",       "id":20520,"ctx":"initandlisten","msg":"Stopping further Flow Control ticket acquisitions."}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.789+00:00"},"s":"I", "c":"CONTROL", "id":20565,"ctx":"initandlisten","msg":"now exiting"}
  MongoMS:MongoInstance {"t":{"$date":"2020-03-24T21:56:47.789+00:00"},"s":"I", "c":"CONTROL", "id":23138,"ctx":"initandlisten","msg":"shutting down with code:{code}","attr":{"code":100}}
  MongoMS:MongoInstance  +0ms
  MongoMS:MongoInstance Mongo[38625]: MongodbInstance: is failed: Mongod shutting down +0ms
Mongod shutting down
    1) should safely start mongo several time
    2) "after each" hook for "should safely start mongo several time"
  MongoMS:MongoInstance Mongo[38625]: [MongoKiller]: exit - [null,"SIGTERM"] +4ms
    3) "after all" hook for "should stop mongo and start again"

where should I look at to fix this? @mikhail-angelov I'm very happy to do a PR when you don't have the time.

mikhail-angelov commented 4 years ago

where should I look at to fix this? looks like the root of the problem is this docker image is built with one version on mongodb, and once we start tests inside docker it try to load another version (latest) it's caused by recent feature I added - add ability to specify mongodb version

hacky fix - remove those lines

    binary: {
      version: opts.version,
    },

but probably there are better solution

I'll add, Docker file for test to run it, just do those commands docker build -t mu . docker run -it mu

mebibou commented 4 years ago

shouldn't we be worried about this as well: https://github.com/nodkz/mongodb-memory-server#known-incompatibilities

mikhail-angelov commented 4 years ago

no, just take it into account and do not use ArchLinux or Alpine inside docker for this lib, standard node docker image (ubuntu) works just fine

bearzk commented 4 years ago

hi @mikhail-angelov I tried with the newly added Dockerfile to run test for this package, but it hangs at here and won't do anything further. Is there maybe something I have missed?

$ docker run -it mu

> mongo-unit@2.0.0 test /app
> mocha test.js

  mongo-unit
Downloading MongoDB latest: 83.1 % (56.4mb / 67.9mb
mikhail-angelov commented 4 years ago

@bearzk my proposal was not implemented yet I'll try to do it today

mikhail-angelov commented 4 years ago

fixed mongo-unit@2.0.1

bearzk commented 4 years ago

Thank you very much!