mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
debug integration: make sure to clear out session on retry
This commit is contained in:
@@ -39,14 +39,23 @@ suite('Debug', function () {
|
||||
|
||||
this.retries(2);
|
||||
test('start debugging', async function () {
|
||||
assert.equal(debug.activeDebugSession, undefined);
|
||||
let stoppedEvents = 0;
|
||||
let variablesReceived: () => void;
|
||||
let initializedReceived: () => void;
|
||||
let configurationDoneReceived: () => void;
|
||||
const toDispose: Disposable[] = [];
|
||||
if (debug.activeDebugSession) {
|
||||
// We are re-running due to flakyness, make sure to clear out state
|
||||
let sessionTerminatedRetry: () => void;
|
||||
toDispose.push(debug.onDidTerminateDebugSession(() => {
|
||||
sessionTerminatedRetry();
|
||||
}));
|
||||
const sessionTerminatedPromise = new Promise<void>(resolve => sessionTerminatedRetry = resolve);
|
||||
await commands.executeCommand('workbench.action.debug.stop');
|
||||
await sessionTerminatedPromise;
|
||||
}
|
||||
|
||||
const firstVariablesRetrieved = new Promise<void>(resolve => variablesReceived = resolve);
|
||||
const toDispose: Disposable[] = [];
|
||||
toDispose.push(debug.registerDebugAdapterTrackerFactory('*', {
|
||||
createDebugAdapterTracker: () => ({
|
||||
onDidSendMessage: m => {
|
||||
|
||||
Reference in New Issue
Block a user