Skip to content

Commit 8267dd9

Browse files
committed
fix: remove all breakpoints before variable tests
1 parent fd4d17a commit 8267dd9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/test/suite/variables.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ suite('Variables', function () {
150150
let client: pg.Client;
151151
let pid: number;
152152
let workspace: vscode.WorkspaceFolder;
153+
let bpLocation: vscode.Location;
153154

154155
suiteSetup('Prepare environment', async () => {
155156
env = getTestEnv();
@@ -180,9 +181,7 @@ suite('Variables', function () {
180181

181182
/* Setup breakpoints */
182183
vscode.debug.removeBreakpoints(vscode.debug.breakpoints);
183-
vscode.debug.addBreakpoints([
184-
new vscode.SourceBreakpoint(await searchBreakpointLocation(), true),
185-
]);
184+
bpLocation = await searchBreakpointLocation();
186185
});
187186

188187
suiteTeardown('Clean environment', async () => {
@@ -201,6 +200,10 @@ suite('Variables', function () {
201200
let variables: vars.Variable[] | undefined;
202201
let queryPromise: Promise<unknown>;
203202
suiteSetup('Run debug and get variables', async () => {
203+
vscode.debug.addBreakpoints([
204+
new vscode.SourceBreakpoint(bpLocation, true),
205+
]);
206+
204207
if (!await vscode.debug.startDebugging(workspace, getDebugConfiguration(dbg, pid))) {
205208
throw new Error('Failed to start debug session');
206209
}
@@ -239,6 +242,8 @@ suite('Variables', function () {
239242

240243
/* Wait for query end, otherwise we might get another race condition */
241244
await queryPromise;
245+
246+
vscode.debug.removeBreakpoints(vscode.debug.breakpoints);
242247
});
243248

244249
const getVar = (name: string, vars?: vars.Variable[]) => {

0 commit comments

Comments
 (0)