Skip to content

Commit 5817244

Browse files
committed
test(MongoMemoryReplSet): enable debug for often open-handle test
1 parent a86c321 commit 5817244

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/mongodb-memory-server-core/src/__tests__/MongoMemoryReplSet.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import * as utils from '../util/utils';
99
import { MongoMemoryInstanceOpts } from '../util/MongoInstance';
1010
import { ReplsetCountLowError, StateError, WaitForPrimaryTimeoutError } from '../util/errors';
1111
import { assertIsError } from './testUtils/test_utils';
12+
import * as debug from 'debug';
1213

1314
jest.setTimeout(100000); // 10s
1415

1516
afterEach(() => {
1617
jest.restoreAllMocks();
18+
debug.disable();
1719
});
1820

1921
describe('single server replset', () => {
@@ -275,6 +277,8 @@ describe('single server replset', () => {
275277
});
276278

277279
it('should make use of "AutomaticAuth" (wiredTiger)', async () => {
280+
// enable debug logs for this test, because it seems to often have a open handle after error
281+
debug.enable('MongoMS:*');
278282
// @ts-expect-error because "initAllServers" is protected
279283
jest.spyOn(MongoMemoryReplSet.prototype, 'initAllServers');
280284
const replSet = await MongoMemoryReplSet.create({

0 commit comments

Comments
 (0)