From 3405ce902e6fbdcf5b95835a32091308ad173775 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 1 Apr 2024 16:35:00 -0400 Subject: [PATCH] When restarting test server with resetting the database, don't forget to close it (#923) --- test/nbrowser/testServer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/nbrowser/testServer.ts b/test/nbrowser/testServer.ts index 16e357e2..417ad8dc 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. + await this.closeDatabase(); + if (process.env.TESTDIR) { this.testDir = path.join(process.env.TESTDIR, workerIdText); } else {