mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
debug integration: make sure to clear out session on retry
This commit is contained in:
parent
0e10a3cbd1
commit
c91e2b62d7
|
@ -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 => {
|
||||
|
|
Loading…
Reference in a new issue