Skip to content

Commit cea0269

Browse files
committed
test/integration/goDebug: wait for debug adapter dispose in teardown test
Change-Id: I95dfbc894f1613c9c5f756b27db8a13ffb349059 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/318891 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Suzy Mueller <[email protected]>
1 parent 41c5ee9 commit cea0269

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/goDebugFactory.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export class DelveDAPOutputAdapter extends ProxyDebugAdapter {
212212
return;
213213
}
214214

215-
if (timeoutMS === undefined) {
215+
if (timeoutMS === undefined || timeoutMS < 0) {
216216
timeoutMS = 1_000;
217217
}
218218
const dlvDapServer = this.dlvDapServer;
@@ -230,7 +230,6 @@ export class DelveDAPOutputAdapter extends ProxyDebugAdapter {
230230
const exitTimeoutToken = setTimeout(() => {
231231
this.logger?.error(`dlv dap process (${dlvDapServer.pid}) isn't responding. Killing...`);
232232
dlvDapServer.kill('SIGINT'); // Don't use treekill but let dlv handle cleaning up the child processes.
233-
resolve();
234233
}, timeoutMS);
235234
dlvDapServer.on('exit', (code, signal) => {
236235
clearTimeout(exitTimeoutToken);

test/integration/goDebug.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ const testAll = (ctx: Mocha.Context, isDlvDap: boolean) => {
15981598

15991599
// Skip the proper disconnect sequence started with a disconnect request.
16001600

1601-
dlvDapAdapter.dispose(1);
1601+
await dlvDapAdapter.dispose(1);
16021602
dc = undefined;
16031603
await sleep(100); // allow dlv to respond and finish cleanup.
16041604
let stat: fs.Stats = null;

0 commit comments

Comments
 (0)