Skip to content

Commit 49c710d

Browse files
committed
fix(MongoInstance): reset "childProcess" and "killerProcess" after "kill"
- reset "childProcess" reference to "undefined" in "stop" - reset "killerProcess" reference to "undefined" in "stop"
1 parent 232b812 commit 49c710d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/mongodb-memory-server-core/src/util/MongoInstance.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,13 @@ export default class MongoInstance extends EventEmitter {
179179

180180
if (!isNullOrUndefined(this.childProcess)) {
181181
await killProcess(this.childProcess, 'childProcess');
182+
this.childProcess = undefined; // reset reference to the childProcess for "mongod"
182183
} else {
183184
this.debug('- childProcess: nothing to shutdown, skipping.');
184185
}
185186
if (!isNullOrUndefined(this.killerProcess)) {
186187
await killProcess(this.killerProcess, 'killerProcess');
188+
this.killerProcess = undefined; // reset reference to the childProcess for "mongo_killer"
187189
} else {
188190
this.debug('- killerProcess: nothing to shutdown, skipping.');
189191
}

0 commit comments

Comments
 (0)