diff --git a/test/nbrowser/testServer.ts b/test/nbrowser/testServer.ts index 16e357e2..3b292768 100644 --- a/test/nbrowser/testServer.ts +++ b/test/nbrowser/testServer.ts @@ -67,6 +67,9 @@ export class TestServerMerged extends EventEmitter implements IMochaServer { this._starts++; const workerIdText = process.env.MOCHA_WORKER_ID || '0'; if (reset) { + // Make sure this test server doesn't keep using the DB that's about to disappear. + this.closeDatabase(); + if (process.env.TESTDIR) { this.testDir = path.join(process.env.TESTDIR, workerIdText); } else {