Skip to content

Dismiss VS Code E2E notifications without depending on hover - #21565

Merged
Ankit Jain (radical) merged 2 commits into
mainfrom
aspireagent/fix-e2e-notification-dismiss-hover-race
Nov 6, 2026
Merged

Ankit Jain (radical) merged 2 commits into
mainfrom
aspireagent/fix-e2e-notification-dismiss-hover-race

Conversation

@davidfowl

@davidfowl David Fowler (davidfowl) commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes an intermittent failure in the VS Code extension tests, not a bug in Aspire itself.

The tests close notifications to clear the screen. Previously, they moved the mouse over a notification and clicked its close button. If another notification appeared or expired, the notification could move away from the mouse and hide the button before the click. The test would then fail with ElementNotInteractableError, even though the feature being tested had worked.

The tests now ask VS Code to clear all notifications through the E2E bridge, which runs VS Code's notifications.clearAll command, instead of clicking a notification. Cleanup keeps its bounded retry until no notifications remain. The Python debugger setup test checks its message and then uses the same cleanup. No feature assertions are weakened, and no new dependencies are required.

Adds unit tests: one checks that cleanup goes through the bridge's clear-all action when a notification can't be clicked, and one checks that the bridge action runs notifications.clearAll. They don't recreate the browser timing race.

Fixes #21742

Validation: CI for the current head is pending. The notification cleanup unit tests passed locally and fail against the old hover-based cleanup. The bridge dispatch test needs the VS Code test host, which couldn't be downloaded locally, so it relies on CI.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

VS Code only displays a notification toast's clear action while the toast is
hovered or focused. Notification.dismiss() from page-objects hovers the toast,
waits for the action to be visible and then clicks it. Toasts re-layout when
another notification arrives or expires, so the toast can move out from under
the pointer between the visibility check and the click, hiding the action and
failing the click with ElementNotInteractableError.

dismissAllNotifications (and the edge-case Python setup notification) now
click the toast's clear action through a script, which does not depend on the
pointer position. dismissAllNotifications still polls until no toasts remain.

Co-authored-by: Copilot <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21565

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21565"

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the change to dismiss notification toasts without hover-dependent controls.

No open issues 🎉

What changed in this PR

This PR addresses intermittent VS Code extension E2E failures by dismissing notification toasts without relying on hover-dependent controls.

Changes:

  • Adds a shared dismissal helper that clicks the clear action through script execution while preserving polling until no toasts remain.
  • Updates the notification interface and edge-case test to use the new helper.
  • Adds a regression test and supporting stub for dismissal without hover.
File Description
extension/​src/​test/​notificationWaitForMessage.test.ts Adds regression coverage for hover-independent dismissal.
extension/​src/​test/​fixtures/​e2e-notification-extester-stub.ts Models notification actions and script-dispatched clicks.
extension/​src/​test-e2e/​helpers/​vscode.ts Adds the dismissal helper and integrates it into notification cleanup.
extension/​src/​test-e2e/​helpers/​extester.ts Exposes element lookup on the notification interface.
extension/​src/​test-e2e/​edgeCases.e2e.test.ts Replaces direct dismissal with the shared helper.

Review effort: Balanced

Copy link
Copy Markdown
Collaborator Author

CI evidence for exact head f1b0aa439cc3a4c6888f927896fc7b5a9649b795, from CI run 41189275609, attempt 1:

  • VS Code extension E2E, diagnostic-logs shard, the one that failed in the field: passed on Windows (4m34s) and Linux (3m16s).
  • VS Code extension E2E, edge-cases shard, which uses the new dismissNotification helper: passed on Windows (5m3s) and Linux (3m58s).
  • All other selected checks passed (71 total) with no failures. The VS Code extension unit tests include the new regression test.
  • No unrelated flakes occurred, so nothing was rerun.

🤖 Posted by AspireAgent (AI Agent)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The change preserves the debugger-guidance assertion and keeps notification cleanup bounded; it does not weaken the behavior this scenario protects. Approving the test-reliability aspect. The outstanding request from Ella to use notifications.clearAll through the E2E bridge remains for the author and maintainer to address before deciding merge readiness; this approval does not resolve or supersede that feedback.

@davidfowl David Fowler (davidfowl) added the agent:working An AI agent is actively working on this issue or PR label Nov 6, 2026 — with Copilot SWE Agent
Address review feedback: instead of clicking a toast's clear action (which
VS Code only shows while the toast is hovered), dismissAllNotifications asks
the E2E bridge to run notifications.clearAll and keeps its bounded retry until
no notifications remain. The Python hint test asserts its message and then uses
the same helper, so the single-notification helper is removed.

Co-authored-by: Copilot <[email protected]>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Tests selector

0 / 101 PR test projects · 2 PR jobs, from 6 changed files.

Selected PR test projects (0 / 101)

none — no PR-gated .NET test projects run for this change.

Selected PR jobs (2)

extension-e2e, extension-unit


How these were chosen — grouped by what changed

Job reasons

Job Triggered by
extension-e2e extension/src/test-e2e/edgeCases.e2e.test.ts, extension/src/test-e2e/helpers/vscode.ts, extension/src/test/e2eStateFileBridge.test.ts, extension/src/test/notificationWaitForMessage.test.ts, extension/src/testing/e2eStateFileBridge.ts, extension/src/types/extensionApi.ts
extension-unit extension/src/test-e2e/edgeCases.e2e.test.ts, extension/src/test-e2e/helpers/vscode.ts, extension/src/test/e2eStateFileBridge.test.ts, extension/src/test/notificationWaitForMessage.test.ts, extension/src/testing/e2eStateFileBridge.ts, extension/src/types/extensionApi.ts

Selection computed for commit e7843f0.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the bridge-based notification cleanup changes.

No open issues 🎉

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@davidfowl David Fowler (davidfowl) removed the agent:working An AI agent is actively working on this issue or PR label Nov 6, 2026
@radical
Ankit Jain (radical) merged commit af45278 into main Nov 6, 2026
180 of 184 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 6, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

docs_optional → test_only. No signals triggered. All changed files are VS Code extension E2E test code and test-only helpers (extension/src/test-e2e/**, extension/src/test/**, extension/src/testing/e2eStateFileBridge.ts, plus a testing-support type in extension/src/types/extensionApi.ts). No user-facing behavior changed.

Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
## Description

Fixes an intermittent failure in the VS Code extension tests, not a bug
in Aspire itself.

The tests close notifications to clear the screen. Previously, they
moved the mouse over a notification and clicked its close button. If
another notification appeared or expired, the notification could move
away from the mouse and hide the button before the click. The test would
then fail with `ElementNotInteractableError`, even though the feature
being tested had worked.

The tests now ask VS Code to clear all notifications through the E2E
bridge, which runs VS Code's `notifications.clearAll` command, instead
of clicking a notification. Cleanup keeps its bounded retry until no
notifications remain. The Python debugger setup test checks its message
and then uses the same cleanup. No feature assertions are weakened, and
no new dependencies are required.

Adds unit tests: one checks that cleanup goes through the bridge's
clear-all action when a notification can't be clicked, and one checks
that the bridge action runs `notifications.clearAll`. They don't
recreate the browser timing race.

Fixes #21742

Validation: CI for the current head is pending. The notification cleanup
unit tests passed locally and fail against the old hover-based cleanup.
The bridge dispatch test needs the VS Code test host, which couldn't be
downloaded locally, so it relies on CI.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
    - If yes, did you have an API Review for it?
      - [ ] Yes
      - [ ] No
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
      - [ ] Yes
      - [ ] No
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
    - If yes, have you done a threat model and had a security review?
      - [ ] Yes
      - [ ] No
  - [x] No

---------

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit af45278)
Mitch Denny (mitchdenny) pushed a commit that referenced this pull request Nov 10, 2026
## Description

Fixes an intermittent failure in the VS Code extension tests, not a bug
in Aspire itself.

The tests close notifications to clear the screen. Previously, they
moved the mouse over a notification and clicked its close button. If
another notification appeared or expired, the notification could move
away from the mouse and hide the button before the click. The test would
then fail with `ElementNotInteractableError`, even though the feature
being tested had worked.

The tests now ask VS Code to clear all notifications through the E2E
bridge, which runs VS Code's `notifications.clearAll` command, instead
of clicking a notification. Cleanup keeps its bounded retry until no
notifications remain. The Python debugger setup test checks its message
and then uses the same cleanup. No feature assertions are weakened, and
no new dependencies are required.

Adds unit tests: one checks that cleanup goes through the bridge's
clear-all action when a notification can't be clicked, and one checks
that the bridge action runs `notifications.clearAll`. They don't
recreate the browser timing race.

Fixes #21742

Validation: CI for the current head is pending. The notification cleanup
unit tests passed locally and fail against the old hover-based cleanup.
The bridge dispatch test needs the VS Code test host, which couldn't be
downloaded locally, so it relies on CI.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
    - If yes, did you have an API Review for it?
      - [ ] Yes
      - [ ] No
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
      - [ ] Yes
      - [ ] No
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
    - If yes, have you done a threat model and had a security review?
      - [ ] Yes
      - [ ] No
  - [x] No

---------

Co-authored-by: davidfowl <[email protected]>
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit af45278)
Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Nov 16, 2026
## Description

Backport of #21565 to `release/17.0` (source commit
`af4527806f2e09424b40e72ab80895fffe82b02f`).

The release branch's Windows diagnostic-log E2E scenario fails while
clearing a notification: the toast's clear-button click at `(11,11)` is
intercepted by the VS Code titlebar. This prevents the scenario from
reliably exercising the current CLI and AppHost log actions.

This exact six-file backport uses the existing E2E control bridge to
invoke VS Code's `notifications.clearAll`, rather than clicking the
toast. Cleanup remains bounded; the feature assertions remain intact.
Behavioral tests cover an unclickable toast and bridge command dispatch.
No skips, quarantine, added retries, timeout increases, dependency
changes, or workflow changes.

Related: #22241; original source issue #21742.

Failure evidence: [release/17.0 push CI, attempt 1, Windows
diagnostic-logs
job](https://github.com/microsoft/aspire/actions/runs/43537211054/job/132276516754),
commit `a509f094e0ee87d17dc0e1cc9bca84f7ca2623da`. That source failure
branch determines the PR base. The earlier backport #22009 is closed and
unmerged; this PR does not modify or reopen it.

### Customer Impact

Release-branch CI can fail during notification cleanup rather than
testing diagnostic-log behavior. This is an E2E reliability fix, not a
change to the shipped log actions or notification UI. Screenshots are
not applicable to this test-control change.

### Testing

The following results were obtained in a prior isolated Linux validation
on the exact target commit above with this exact source patch; they are
reused here, not presented as new executions:

| Command (from `extension/` unless noted) | Result |
| --- | --- |
| `corepack yarn run compile-tests` | Passed, including recompilation
after restoring the fix. |
| `corepack yarn exec mocha -- --ui tdd
out/test/notificationWaitForMessage.test.js --grep 'dismisses
notifications through VS Code clear-all'` | Expected failure with the
original `notifications[0].dismiss()` restored and the new test
retained: 0 passed, 1 failed with `ElementNotInteractableError`. This is
a behavioral regression proof, not an actual Windows reproduction. |
| `corepack yarn run compile-e2e` | Passed. |
| `corepack yarn run compile-tests` followed by `corepack yarn exec
mocha -- --ui tdd out/test/notificationWaitForMessage.test.js` | Passed:
9 tests with the fix restored. Recompilation is needed because the E2E
compiler replaces shared output. |
| `corepack yarn exec eslint -- src/test-e2e/helpers/vscode.ts
src/test-e2e/edgeCases.e2e.test.ts src/test/e2eStateFileBridge.test.ts
src/test/notificationWaitForMessage.test.ts
src/testing/e2eStateFileBridge.ts src/types/extensionApi.ts` | Passed. |
| `git diff --exit-code && git diff --cached --check` (repository root)
| Passed; only the exact source patch was staged. |

For this PR preparation, `git cherry-pick --no-commit
af45278` and `git diff --cached
--check` passed again on the same target.

**Current-head validation:** [CI run
43689787525](https://github.com/microsoft/aspire/actions/runs/43689787525)
completed successfully at `58e2a9ea9fe792491c87dce7a723b389f3b816b7`.
Windows diagnostic-logs passed 2/2, edge-cases 6/6, tree-actions 7/7,
and VS Code-hosted unit tests passed 4,153 with 9 pre-existing pending
tests. The required `Final Results` check passes. Independent review of
this exact head passed; there are no unresolved review threads.

Attempt 1 required workflow approval and ran no tests. Attempt 2 exposed
existing release-branch tree URL readiness, global fake-timer, and ARM64
packaging failures; attempt 3 completed successfully. The earlier
failures remain part of the CI record, not evidence of first-attempt
reliability or branch recovery. Notification cleanup does not change
resource URL snapshots; the timer tests use the pre-existing global fake
clock. Separate fixes already on main address those tree/timer races and
are not folded into this backport.

The existing test-selection map routes `extension/**` to extension unit
and E2E jobs; no routing change is needed. The current release tip
`6a7a7c49dc62640bc28cb6f9e613422540380206` has no `extension/` changes
relative to the tested base. Human review and shiproom approval remain
required. A later eligible scheduled/push CI run exercising the merged
fix is required before declaring branch recovery.

### Risk

Low: the change is confined to E2E notification cleanup and its existing
test-control bridge. It preserves bounded cleanup and the diagnostic-log
assertions. Windows and hosted validation passed at the PR head.

### Regression?

Unknown: the failure and matching main-branch fix are established, but
the introducing version or commit is not.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [x] Yes
  - [ ] No
- Did you add public API?
  - [ ] Yes
    - If yes, did you have an API Review for it?
      - [ ] Yes
      - [ ] No
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
      - [ ] Yes
      - [ ] No
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
    - If yes, have you done a threat model and had a security review?
      - [ ] Yes
      - [ ] No
  - [x] No

<!-- ci-health:work:release17-diagnostic-logs-windows -->
<!-- ci-health:worker:v1 -->
🤖 AspireAssistant

Co-authored-by: radical <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-vscode-extension ci-health Fixes CI flakiness or CI infrastructure (AspireAgent queue)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI Failure] Flaky: VS Code extension E2E diagnostic-logs times out waiting for element to become visible

5 participants