Skip to content

Commit 1e52263

Browse files
fix failing tests
1 parent 5df9384 commit 1e52263

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/integration/read-write-concern/write_concern.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
OpMsgRequest
1414
} from '../../mongodb';
1515
import * as mock from '../../tools/mongodb-mock/index';
16+
import { sleep } from '../../tools/utils';
1617
import { filterForCommands } from '../shared';
1718

1819
describe('Write Concern', function () {
@@ -98,6 +99,7 @@ describe('Write Concern', function () {
9899

99100
afterEach(async function () {
100101
await db.dropDatabase();
102+
await sleep(1000);
101103
await client.close();
102104
});
103105

@@ -134,9 +136,10 @@ describe('Write Concern', function () {
134136
await col.createIndex({ b: -1 });
135137
await col.createIndex({ a: 1, b: -1 });
136138

139+
await sleep(1000);
140+
137141
const listIndexesResult = col.listIndexes({ batchSize: 2 });
138142
const err = await listIndexesResult.toArray().catch(e => e);
139-
140143
expect(err).to.not.be.instanceOf(Error);
141144
});
142145

@@ -165,6 +168,8 @@ describe('Write Concern', function () {
165168
{ writeConcern: { w: 'majority' } }
166169
);
167170

171+
await sleep(1000);
172+
168173
const err = await changes.next().catch(e => e);
169174
expect(err).to.not.be.instanceOf(Error);
170175
}

0 commit comments

Comments
 (0)