Skip to content

Fix Azure Functions E2E polling after reload - #19237

Merged
Adam Ratzman (adamint) merged 11 commits into
mainfrom
ellahathaway-investigate-vscode-functions-e2e-timeout
Aug 19, 2026
Merged

Adam Ratzman (adamint) merged 11 commits into
mainfrom
ellahathaway-investigate-vscode-functions-e2e-timeout

Conversation

@ellahathaway

@ellahathaway Ella Hathaway (ellahathaway) commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

The Linux Azure Functions extension E2E shard timed out waiting for e2e-functions even though the AppHost and DCP resource had already reached Running.

The E2E runner starts VS Code with the generated workspace open. The scenario now opens the Aspire view and drives VS Code's Developer: Reload Window command from the ExTester process, which survives the extension-host restart. Before reloading, it clears the last control payload so the fresh host cannot replay a stale command. It then waits for a new extension-host session, the reloaded workbench, and AppHost discovery before reopening the Aspire view.

This matters because AppHostDataRepository intentionally activates aspire ps and aspire describe polling only while the Aspire view is visible or an AppHost file is open; after reload, VS Code returns to Explorer and polling otherwise remains inactive. The reload cannot be awaited through the extension-host control bridge because that host terminates before it can acknowledge its own reload.

This change exercises the real reload path before reopening the Aspire view and adds focused source-order and reload-synchronization regression coverage. It does not increase the timeout or change production polling behavior.

Validation:

  • corepack yarn --silent compile-tests
  • corepack yarn --silent compile-e2e
  • .\node_modules\.bin\mocha.cmd out\test\e2eLaunchProfile.test.js --ui tdd --grep "reloads outside the extension host|reloads the generated Azure Functions workspace"
  • .\node_modules\.bin\mocha.cmd out\test\e2eLaunchProfile.test.js --ui tdd --grep "defaults to the newest VS Code with the legacy macOS executable path while the internal feed lacks newer ExTester|reloads outside the extension host|reloads the generated Azure Functions workspace"
  • corepack yarn --silent lint
  • Linux Azure Functions E2E

Fixes #19151

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3f178928-33f0-44eb-8e52-83bcdf1af89f
Copilot AI balanced review requested due to automatic review settings August 11, 2026 17:10
@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 -- 19237

Or

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

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.

Pull request overview

Fixes Azure Functions extension E2E resource polling after workspace reload.

Changes:

  • Reopens the Aspire view after loading the generated workspace.
  • Adds regression coverage enforcing the required operation order.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
extension/src/test-e2e/azureFunctions.e2e.test.ts Reactivates visibility-driven polling after reload.
extension/src/test/e2eLaunchProfile.test.ts Verifies the Aspire view reopens before AppHost launch.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

This comment has been minimized.

@github-actions

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.

@ellahathaway

Copy link
Copy Markdown
Contributor Author

Needs #19142

…athaway-investigate-vscode-functions-e2e-timeout
Copilot AI review requested due to automatic review settings August 12, 2026 17:16
@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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@github-actions

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 12, 2026 18:06
@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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.github/workflows/extension-e2e-tests.yml:430

  • The azure-functions matrix entry still has allowFailure: true (line 270), so run-e2e.js converts completed Mocha failures—including this polling regression—into a successful job. That leaves the shard non-blocking despite #19151 requiring the skip to be removed once fixed. Before merging, set this shard to allowFailure: false so the regression test protects CI.
            echo "ASPIRE_EXTENSION_E2E_DOTNET_RUNTIME_VSIX=$dotnet_runtime_vsix"
            echo "ASPIRE_EXTENSION_E2E_CSHARP_VSIX=$csharp_vsix"

@github-actions

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.

@ellahathaway

Copy link
Copy Markdown
Contributor Author

Blocked on #19299

Copilot AI review requested due to automatic review settings August 17, 2026 17:08

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

.github/workflows/extension-e2e-tests.yml:429

  • The Azure Functions matrix still sets advisoryIssue to #19151. run-e2e.js returns success for completed Mocha failures whenever that value is present, so the exact polling timeout this PR fixes would remain non-blocking and the shard cannot provide the stated final confirmation. Remove this advisory marker when re-enabling the fixed shard.
            echo "ASPIRE_EXTENSION_E2E_DOTNET_RUNTIME_VSIX=$dotnet_runtime_vsix"
            echo "ASPIRE_EXTENSION_E2E_CSHARP_VSIX=$csharp_vsix"

extension/scripts/run-e2e.js:786

  • These new required variables make the documented local Azure Functions E2E command fail in resolveRequiredVsixPath: extension/CONTRIBUTING.md:124-127 still supplies only the Resource Groups and Functions VSIXes and says only those two extensions are installed. Update that command and prerequisite/version text with the .NET runtime and C# VSIX requirements.
      path: resolveRequiredVsixPath('ASPIRE_EXTENSION_E2E_DOTNET_RUNTIME_VSIX'),
    },
    {
      displayName: 'C#',
      path: resolveRequiredVsixPath('ASPIRE_EXTENSION_E2E_CSHARP_VSIX'),

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Suppressed comments (2)

extension/src/test-e2e/helpers/fixtures.ts:98

  • A fresh state-file session only proves that the new extension host has activated; it does not guarantee that the reloaded workbench DOM is ready. The next openAspireView() immediately drives the command palette, whose retries cover less than a second, so a slow Linux reload can still fail before the UI is usable. After observing the new session ID, wait for VSBrowser.instance.waitForWorkbench(...) before returning from this helper.
    await waitForExtensionState(
        file => file.extensionHostSessionId !== previousExtensionHostSessionId,
        'extension host to reload with the E2E workspace open',
        timeoutMs);

extension/src/test-e2e/azureFunctions.e2e.test.ts:33

  • This comment attributes the transition to opening the workspace, but the immediately preceding operation is an explicit Developer window reload; the generated workspace was already open. Describe the reload instead so the synchronization reason remains accurate.
        // Opening the generated workspace reloads the extension host and returns VS Code to Explorer.

@github-actions

This comment has been minimized.

Copilot AI review requested due to automatic review settings August 17, 2026 20:50
@ellahathaway
Ella Hathaway (ellahathaway) force-pushed the ellahathaway-investigate-vscode-functions-e2e-timeout branch from 2c43cfd to 9b28c89 Compare August 17, 2026 20:57

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

extension/src/test-e2e/azureFunctions.e2e.test.ts:34

  • This comment attributes the extension-host restart to opening the generated workspace, but the workspace is already open and reloadWorkspaceForE2E() now invokes Developer: Reload Window. Describe the explicit window reload so the regression trigger is accurate.
        // Opening the generated workspace reloads the extension host and returns VS Code to Explorer.
        // Reopen the Aspire view so its visibility-driven runtime state polling observes the AppHost.

Copilot AI review requested due to automatic review settings August 17, 2026 20:59

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

extension/src/test-e2e/azureFunctions.e2e.test.ts:34

  • This comment attributes the extension-host reload to opening the generated workspace, but the reload is performed explicitly by reloadWorkspaceForE2E() above. Describing the wrong trigger obscures the regression this scenario is protecting; identify Developer: Reload Window as the action that returns VS Code to Explorer.
        // Opening the generated workspace reloads the extension host and returns VS Code to Explorer.
        // Reopen the Aspire view so its visibility-driven runtime state polling observes the AppHost.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2b4c4a39-0a82-4f11-abfc-a737ab3c3758
Copilot AI review requested due to automatic review settings August 17, 2026 22:06
@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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@github-actions

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2b4c4a39-0a82-4f11-abfc-a737ab3c3758
Copilot AI review requested due to automatic review settings August 18, 2026 17:33

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

1 / 102 test projects · 2 jobs, from 9 changed files.

Selected test projects (1 / 102)

Infrastructure.Tests

Selected jobs (2)

extension-e2e, extension-unit


How these were chosen — grouped by what changed

📄 .github/workflows/extension-e2e-tests.yml (changed)
→ 1 directly: Infrastructure.Tests

Job reasons

Job Triggered by
extension-e2e .github/workflows/extension-e2e-tests.yml, extension/scripts/run-e2e.js, extension/src/test-e2e/azureFunctions.e2e.test.ts, extension/src/test-e2e/helpers/fixtures.ts, extension/src/test-e2e/helpers/vscode.ts, extension/src/test/e2eLaunchProfile.test.ts, extension/src/test/e2eShardMatrix.test.ts, extension/src/testing/e2eStateFileBridge.ts, extension/src/types/extensionApi.ts
extension-unit extension/scripts/run-e2e.js, extension/src/test-e2e/azureFunctions.e2e.test.ts, extension/src/test-e2e/helpers/fixtures.ts, extension/src/test-e2e/helpers/vscode.ts, extension/src/test/e2eLaunchProfile.test.ts, extension/src/test/e2eShardMatrix.test.ts, extension/src/testing/e2eStateFileBridge.ts, extension/src/types/extensionApi.ts

Selection computed for commit e0fc01e.

@adamint
Adam Ratzman (adamint) merged commit b6dea01 into main Aug 19, 2026
754 of 757 checks passed
@adamint
Adam Ratzman (adamint) deleted the ellahathaway-investigate-vscode-functions-e2e-timeout branch August 19, 2026 16:33
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.6 milestone Aug 19, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch taken: docs_optional → test_only (treated as a false-positive override of the single triggered signal).

Triggered signals (1): pr_body_has_cli_flag_mention — evidence hint was the PR body's Validation section listing shell commands like corepack yarn --silent compile-tests and a mocha.cmd invocation with --grep. These are developer test-runner commands, not a user-facing Aspire CLI flag, so this is a false positive of the signal.

Changed-file justification: All 10 changed files are internal E2E test infrastructure for the VS Code extension test suite: .github/workflows/extension-e2e-tests.yml (CI workflow), extension/scripts/run-e2e.js (test runner script), extension/CONTRIBUTING.md (contributor-facing doc, not product docs), and the remaining 7 files under extension/src/test-e2e/** and extension/src/test/** (E2E fixtures, helpers, and unit tests for the reload-polling regression). No files under src/ (production Aspire code) were touched, and the PR itself states "It does not increase the timeout or change production polling behavior." This matches the test_only / build_or_ci_only allowlist categories — no product behavior, CLI surface, or public API changed, so there is nothing to document on microsoft/aspire.dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS Code extension E2E azure-functions shard times out waiting for e2e-functions

4 participants