Skip to content

Fix flaky AI assistant skill menu test (await default skill render)#4940

Open
habdelra wants to merge 2 commits into
mainfrom
worktree-fix-ai-assistant-add-same-skills-flake
Open

Fix flaky AI assistant skill menu test (await default skill render)#4940
habdelra wants to merge 2 commits into
mainfrom
worktree-fix-ai-assistant-add-same-skills-flake

Conversation

@habdelra
Copy link
Copy Markdown
Contributor

Summary

  • ai-assistant-test.gts opens the skill menu twice in the "Add Same Skills" test. The first open already uses a waitUntil for the attached-card count; the second open (after a plain new-session click) was asserting directly, racing the async default-skill (envSkillId) attachment.
  • Mirror the symmetric waitUntil and surface the observed attached-card list if the wait times out, so the next failure is debuggable.

Observed failure on CS-11236 CI shard 1: Element [data-test-skill-menu] [data-test-attached-card] does not exist (expected: exists once).

Test plan

  • CI Host shards pass.
  • Run packages/host acceptance test "Add Same Skills" copies skill configuration to new session locally.

…l menu

The "Add Same Skills" acceptance test opens the skill menu twice. The
first open (after copying skills) uses a waitUntil for the attached-card
count to settle. The second open (after a plain new-session click that
attaches only the default env skill) skipped that wait and asserted
directly, racing the async default-skill attachment.

Mirror the symmetric waitUntil and surface the observed attached-card
list if the wait times out, so the next failure is debuggable.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Preview deployments

Host Test Results

    1 files  ±0      1 suites  ±0   1h 51m 53s ⏱️ + 4m 30s
2 724 tests ±0  2 709 ✅ ±0  15 💤 ±0  0 ❌ ±0 
2 743 runs  ±0  2 728 ✅ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit 41c8493. ± Comparison against earlier commit a7a8430.

Realm Server Test Results

    1 files  ±0      1 suites  ±0   10m 22s ⏱️ + 1m 1s
1 482 tests ±0  1 482 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 573 runs  ±0  1 573 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 41c8493. ± Comparison against earlier commit a7a8430.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a flaky acceptance test around opening the AI assistant skill menu after creating a new session, by waiting for the default skill (derived from envSkillId) to finish rendering before asserting on attached cards.

Changes:

  • Add a second waitUntil after the “new session” click flow to wait for exactly one attached card to appear in the skill menu.
  • On timeout, collect and surface the observed attached-card IDs to make failures easier to debug.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

false,
`Default skill never rendered on the new session's skill menu. Attached cards seen: ${JSON.stringify(attached)}; expected exactly [${envSkillId}].`,
);
throw e;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Claude Code 🤖] Good catch — switched the catch branch to assert.ok(false, …); return; (no rethrow), so the test ends with one diagnostic assertion failure instead of an assertion + an uncaught timeout. Fixed in 41c8493.

Drop the rethrow after assert.ok(false, …) and return instead so QUnit
records a single, descriptive failure rather than an assertion plus an
uncaught waitUntil timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants