When restarting test server with resetting the database, don't forget to close it

This commit is contained in:
Dmitry S 2024-04-01 15:48:57 -04:00
parent 2140900d58
commit 01b9d30c45

View File

@ -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 {