Conversation
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.
There was a problem hiding this comment.
Pull request overview
Reduces flakiness in sourcemap.test.ts by attempting to ensure the CodeQL VS Code extension is activated before the test runs.
Changes:
- Import
getActivatedExtension()into the sourcemap CLI integration test. - Add a
beforeEachhook that callsgetActivatedExtension()prior to running the test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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(); | ||
| }); |
There was a problem hiding this comment.
This suite already activates the CodeQL extension via the CLI integration Jest setup (extensions/ql-vscode/test/vscode-tests/cli-integration/jest.setup.ts calls beforeAllAction(), which calls getActivatedExtension() in jest.activated-extension.setup.ts). Adding another getActivatedExtension() here is therefore redundant and can be misleading when diagnosing the flake. Consider removing this hook, switching it to beforeAll, or moving any required readiness/wait logic into the shared setup so all tests benefit consistently.
This PR addresses "Client is not running" test flakiness in
sourcemap.test.tsby callinggetActivatedExtension(), which ensures that the language server is fully up and running, before the test starts.Fixes: #4255