From 2253208bafd2b04047ada1fbd313cd727295c458 Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Mon, 8 Jun 2026 13:56:49 +0200 Subject: [PATCH] Try to fix Chat smoke test flake (#320380) * Try to fix Chat smoke test flake --- .../vscode-smoketest-ext-host/extension.js | 10 ++++++---- test/smoke/src/areas/chat/chatSessions.test.ts | 12 ++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/test/smoke/extensions/vscode-smoketest-ext-host/extension.js b/test/smoke/extensions/vscode-smoketest-ext-host/extension.js index fa0a5837867..bc4260c3b17 100644 --- a/test/smoke/extensions/vscode-smoketest-ext-host/extension.js +++ b/test/smoke/extensions/vscode-smoketest-ext-host/extension.js @@ -91,11 +91,15 @@ function activate(context) { }) ); + // Open a chat session editor of the given type. The required settings + // (chat.disableAIFeatures = false, the corresponding *Agent.enabled flag) + // must be written to settings.json by the test before invoking this + // command. Writing them here via `workspace.getConfiguration().update()` + // races with copilot-chat registering its configuration schema and was + // the source of the original Chat Sessions smoke test flake. context.subscriptions.push( vscode.commands.registerCommand('smoketest.openCopilotCliChat', async () => { const command = 'workbench.action.chat.openNewSessionEditor.copilotcli'; - await vscode.workspace.getConfiguration('chat').update('disableAIFeatures', false, vscode.ConfigurationTarget.Global); - await vscode.workspace.getConfiguration('github.copilot.chat').update('backgroundAgent.enabled', true, vscode.ConfigurationTarget.Global); await vscode.commands.executeCommand('github.copilot.debug.extensionState'); await waitForCommand(command, 60_000); await vscode.commands.executeCommand('workbench.action.closeAllEditors'); @@ -106,8 +110,6 @@ function activate(context) { context.subscriptions.push( vscode.commands.registerCommand('smoketest.openClaudeChat', async () => { const command = 'workbench.action.chat.openNewSessionEditor.claude-code'; - await vscode.workspace.getConfiguration('chat').update('disableAIFeatures', false, vscode.ConfigurationTarget.Global); - await vscode.workspace.getConfiguration('github.copilot.chat').update('claudeAgent.enabled', true, vscode.ConfigurationTarget.Global); await vscode.commands.executeCommand('github.copilot.debug.extensionState'); await waitForCommand(command, 60_000); await vscode.commands.executeCommand('workbench.action.closeAllEditors'); diff --git a/test/smoke/src/areas/chat/chatSessions.test.ts b/test/smoke/src/areas/chat/chatSessions.test.ts index 54f9fc2361b..1c7508689de 100644 --- a/test/smoke/src/areas/chat/chatSessions.test.ts +++ b/test/smoke/src/areas/chat/chatSessions.test.ts @@ -73,6 +73,14 @@ export function setup(logger: Logger) { ['github.copilot.chat.githubMcpServer.enabled', 'false'], ['chat.mcp.discovery.enabled', 'false'], ['chat.mcp.enabled', 'false'], + // Pre-enable the chat session types that the tests open. Writing + // these here (directly to settings.json) instead of from the + // smoketest extension avoids racing with copilot-chat registering + // its configuration schema — the original cause of the Chat + // Sessions smoke test flake. + ['chat.disableAIFeatures', 'false'], + ['github.copilot.chat.backgroundAgent.enabled', 'true'], + ['github.copilot.chat.claudeAgent.enabled', 'true'], // Force the bundled Claude Agent SDK (avoid the experiment that // would route through the ms-vscode.vscode-claude-sdk extension, // which would attempt a network install during the smoke run). @@ -84,7 +92,7 @@ export function setup(logger: Logger) { await mockServer?.close(); }); - it.skip('Test Copilot CLI session', async function () { + it('Test Copilot CLI session', async function () { const app = this.app as Application; const requestsBefore = mockServer.requestCount(); @@ -106,7 +114,7 @@ export function setup(logger: Logger) { ); }); - it.skip('Test Claude session', async function () { + it('Test Claude session', async function () { const app = this.app as Application; const requestsBefore = mockServer.requestCount(); logger.log(`Chat Sessions (Claude) mock requests before: ${requestsBefore}`);