From 5fad5a3acbb770be9eefb98b6f20a9abbcc159ea Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Tue, 4 Feb 2025 10:25:44 -0500 Subject: [PATCH] test: remove unnecessary test quirk re: CR comments --- test/connection.test.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/connection.test.js b/test/connection.test.js index ae445fb3b12..5e5946645f4 100644 --- a/test/connection.test.js +++ b/test/connection.test.js @@ -1805,12 +1805,7 @@ describe('connections:', function() { const m = new mongoose.Mongoose(); m.set('bufferTimeoutMS', 100); - // Delayed `assert.rejects()` pattern, because using the usual `await assert.rejects()` pattern _after_ the `setTimeout()` - // call below would lead to an unhandled promise rejection. - const promise = assert.rejects(m.connection.listCollections(), /Connection operation buffering timed out after 100ms/); - - await new Promise(resolve => setTimeout(resolve, 200)); - await promise; + await assert.rejects(m.connection.listCollections(), /Connection operation buffering timed out after 100ms/); }); it('supports db-level aggregate on connection (gh-15118)', async function() {