Closed arthursimas1 closed 11 months ago
Merging #811 (b58958a) into master (c1f2333) will increase coverage by
0.20%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #811 +/- ##
==========================================
+ Coverage 90.94% 91.14% +0.20%
==========================================
Files 15 15
Lines 1965 1965
Branches 494 494
==========================================
+ Hits 1787 1791 +4
+ Misses 169 165 -4
Partials 9 9
Files | Coverage Δ | |
---|---|---|
...ngodb-memory-server-core/src/util/MongoInstance.ts | 98.61% <100.00%> (+1.84%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
:tada: This PR is included in version 9.0.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
hey @hasezoey. I've tried the following options:
// 1)
con = await MongoClient.connect(uriTemplate(ip, port, 'admin'), {
...this.extraConnectionOptions,
directConnection: true,
socketTimeoutMS: 100,
connectTimeoutMS: 100,
waitQueueTimeoutMS: 100,
});
// 2)
con = await MongoClient.connect(uriTemplate(ip, port, 'admin'), {
...this.extraConnectionOptions,
directConnection: true,
serverSelectionTimeoutMS: 100,
});
Only the 2) case works. Right now I cannot think out of my head a test case for this alternative solution.
Testing some cases, it is possible that the server is killed between the isAlive assert and the connection. I agree that it's better to use the connection options. I'll send another PR.
I agree that it's better to use the connection options. I'll send another PR.
no need to replace the change from the current PR, the options are only meant because it should not have much latency because it will always connect to localhost and so 30 second timeout is somewhat high
I've a situation where I listen to kill signals and execute
.stop()
when needed. The replica set has already been killed because theCtrl + C
signal is propagated to the whole process group, then I waits forever to connect and send a graceful shutdown.