From 7ca5e034a43522e07697915058b9928f8a364855 Mon Sep 17 00:00:00 2001 From: Aditi Khare Date: Thu, 12 Sep 2024 12:02:27 -0400 Subject: [PATCH] requested changes 1 --- test/integration/read-write-concern/write_concern.test.ts | 8 +------- test/unit/commands.test.ts | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/test/integration/read-write-concern/write_concern.test.ts b/test/integration/read-write-concern/write_concern.test.ts index 9d479a2271..64e656e4df 100644 --- a/test/integration/read-write-concern/write_concern.test.ts +++ b/test/integration/read-write-concern/write_concern.test.ts @@ -13,7 +13,6 @@ import { OpMsgRequest } from '../../mongodb'; import * as mock from '../../tools/mongodb-mock/index'; -import { sleep } from '../../tools/utils'; import { filterForCommands } from '../shared'; describe('Write Concern', function () { @@ -98,8 +97,7 @@ describe('Write Concern', function () { }); afterEach(async function () { - await db.dropDatabase(); - await sleep(1000); + await db.dropDatabase({ writeConcern: { w: 'majority' } }); await client.close(); }); @@ -136,8 +134,6 @@ describe('Write Concern', function () { await col.createIndex({ b: -1 }); await col.createIndex({ a: 1, b: -1 }); - await sleep(1000); - const listIndexesResult = col.listIndexes({ batchSize: 2 }); const err = await listIndexesResult.toArray().catch(e => e); expect(err).to.not.be.instanceOf(Error); @@ -168,8 +164,6 @@ describe('Write Concern', function () { { writeConcern: { w: 'majority' } } ); - await sleep(1000); - const err = await changes.next().catch(e => e); expect(err).to.not.be.instanceOf(Error); } diff --git a/test/unit/commands.test.ts b/test/unit/commands.test.ts index 2b2cf5f58b..3f601c678c 100644 --- a/test/unit/commands.test.ts +++ b/test/unit/commands.test.ts @@ -111,7 +111,7 @@ describe('class OpCompressedRequest', () => { }); describe('OpMsgRequest', () => { - describe('fire-and-forget', () => { + describe('#constructor', () => { context('when writeConcern = 0', () => { it('moreToCome is set to true', async () => { const request = new OpMsgRequest('db', { a: 1, writeConcern: { w: 0 } }, {});