linger only in normal shutdown

This commit is contained in:
Florian Dold 2020-08-07 12:18:17 +05:30
parent 8b6f4c1ff0
commit 75b88c209e
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -265,11 +265,6 @@ export class GlobalTestState {
} }
private shutdownSync(): void { private shutdownSync(): void {
if (shouldLingerAlways()) {
console.log("*** test finished, but requested to linger");
console.log("*** test state can be found under", this.testDir);
return;
}
for (const s of this.servers) { for (const s of this.servers) {
s.close(); s.close();
s.removeAllListeners(); s.removeAllListeners();
@ -319,6 +314,11 @@ export class GlobalTestState {
} }
this.inShutdown = true; this.inShutdown = true;
console.log("shutting down"); console.log("shutting down");
if (shouldLingerAlways()) {
console.log("*** test finished, but requested to linger");
console.log("*** test state can be found under", this.testDir);
return;
}
for (const s of this.servers) { for (const s of this.servers) {
s.close(); s.close();
s.removeAllListeners(); s.removeAllListeners();