Skip to content

Commit f046bf3

Browse files
committed
Address sourcemap.test.ts flakiness
This commit addresses "Client is not running" test flakiness in sourcemap.test.ts by calling getActivatedExtension(), which ensures that the language server is fully up and running, before the test starts.
1 parent 8fcde39 commit f046bf3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

extensions/ql-vscode/test/vscode-tests/cli-integration/sourcemap.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ import { tmpDir } from "../../../src/tmp-dir";
44
import { readFile, writeFile, ensureDir, copy } from "fs-extra";
55
import { createVSCodeCommandManager } from "../../../src/common/vscode/commands";
66
import type { AllCommands } from "../../../src/common/commands";
7+
import { getActivatedExtension } from "../global.helper";
78

89
/**
910
* Integration tests for queries
1011
*/
1112
describe("SourceMap", () => {
1213
const commandManager = createVSCodeCommandManager<AllCommands>();
1314

15+
beforeEach(async () => {
16+
// Ensure that the extension is fully activated before running tests. This is important
17+
// because the extension activate() function ensures that the language server is up and
18+
// running before returning, so that we don't get "Client is not running" test flakes.
19+
await getActivatedExtension();
20+
});
21+
1422
it("should jump to QL code", async () => {
1523
const root = workspace.workspaceFolders![0].uri.fsPath;
1624
const srcFiles = {

0 commit comments

Comments
 (0)