Skip to content

Commit 3470ec5

Browse files
committed
✅ Fix a slightly flaky test
Sometimes this test fails with: ``` 1) mongo db connection via url string with mongoPoll and pollDelay option delays queryPoll but not commit: Uncaught AssertionError: expected 1000 to be above 1000 + expected - actual at /home/runner/work/sharedb-mongo/sharedb-mongo/test/test_mongo.js:541:48 at /home/runner/work/sharedb-mongo/sharedb-mongo/index.js:133:2086 at /home/runner/work/sharedb-mongo/sharedb-mongo/index.js:133:109 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ``` We don't care about the exact millisecond, so this change updates the assertion to `greaterThanOrEqual()`
1 parent dc887c7 commit 3470ec5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_mongo.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ describe('mongo db connection', function() {
538538
db.queryPoll('testcollection', {}, null, function(err, results) {
539539
if (err) return done(err);
540540
expect(results.length).eql(1);
541-
expect((new Date) - timeBeforeQuery).greaterThan(pollDelay);
541+
expect((new Date) - timeBeforeQuery).greaterThanOrEqual(pollDelay);
542542
done();
543543
});
544544
});

0 commit comments

Comments
 (0)