From f046bf3d3ffc6bdf0c1d3b000d889e1ede0ac6ee Mon Sep 17 00:00:00 2001 From: Chuan-kai Lin Date: Tue, 27 Jan 2026 14:26:57 -0800 Subject: [PATCH] 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. --- .../test/vscode-tests/cli-integration/sourcemap.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/ql-vscode/test/vscode-tests/cli-integration/sourcemap.test.ts b/extensions/ql-vscode/test/vscode-tests/cli-integration/sourcemap.test.ts index b63b429d26a..5ce97e9c208 100644 --- a/extensions/ql-vscode/test/vscode-tests/cli-integration/sourcemap.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/cli-integration/sourcemap.test.ts @@ -4,6 +4,7 @@ import { tmpDir } from "../../../src/tmp-dir"; import { readFile, writeFile, ensureDir, copy } from "fs-extra"; import { createVSCodeCommandManager } from "../../../src/common/vscode/commands"; import type { AllCommands } from "../../../src/common/commands"; +import { getActivatedExtension } from "../global.helper"; /** * Integration tests for queries @@ -11,6 +12,13 @@ import type { AllCommands } from "../../../src/common/commands"; describe("SourceMap", () => { const commandManager = createVSCodeCommandManager(); + beforeEach(async () => { + // Ensure that the extension is fully activated before running tests. This is important + // because the extension activate() function ensures that the language server is up and + // running before returning, so that we don't get "Client is not running" test flakes. + await getActivatedExtension(); + }); + it("should jump to QL code", async () => { const root = workspace.workspaceFolders![0].uri.fsPath; const srcFiles = {