Skip to content

chore(mcp): capture detached dashboard daemon stdio for diagnostics#40518

Draft
Skn0tt wants to merge 5 commits intomicrosoft:mainfrom
Skn0tt:debug-dashboard-daemon-stdio
Draft

chore(mcp): capture detached dashboard daemon stdio for diagnostics#40518
Skn0tt wants to merge 5 commits intomicrosoft:mainfrom
Skn0tt:debug-dashboard-daemon-stdio

Conversation

@Skn0tt
Copy link
Copy Markdown
Member

@Skn0tt Skn0tt commented Apr 30, 2026

Summary

Diagnostic-only change to surface why tests/mcp/dashboard.spec.ts fails with Cannot read properties of undefined (reading 'endpoint') on windows-latest-firefox runs.

The dashboard daemon is spawned detached with stdio: 'ignore', so chromium launch failures inside it are completely invisible — we only see the downstream connectToDashboard timeout.

This PR opts the daemon into writing stdout+stderr to a per-test log file (via PWTEST_DASHBOARD_DAEMON_LOG), bumps DEBUG=pw:browser* for the cli child env, and attaches the log on test failure.

Not for merge — open as draft so we can read the daemon log from the failing windows-firefox MCP runs.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Skn0tt added 3 commits April 30, 2026 16:20
Investigating recurring `Cannot read properties of undefined (reading
'endpoint')` failures of `tests/mcp/dashboard.spec.ts` on
windows-latest-firefox runs. The dashboard daemon is currently spawned
detached with `stdio: 'ignore'`, so when its chromium launch fails or
hangs we have zero visibility — only the downstream `connectToDashboard`
timeout shows up.

This change adds an opt-in log file:

- `cli show` (and `--kill`/`--annotate`) now redirect detached daemon
  stdout+stderr to `PWTEST_DASHBOARD_DAEMON_LOG` when set; otherwise
  behavior is unchanged.
- The MCP `cli` test fixture sets that env var to a per-test file under
  the test outputDir, bumps `DEBUG=pw:browser*` so chromium launch
  errors surface, and on test failure attaches the log to the test
  result so it appears in CI artifacts.

Diagnostic only; no production behavior change.
Surfaces .err logs from cli-session browser daemons and the http MCP
server's pw:browser* output on test failure so we can diagnose the
windows-firefox cli-session/http timeouts.
…t race

browser_navigate resolves on the page's load event, which can fire
before fire-and-forget fetches in an inline script complete. Wrap the
assertions in expect(...).toPass() so the snapshot is retried until
all expected requests are visible. Observed flake on windows-msedge.
@github-actions

This comment has been minimized.

@Skn0tt Skn0tt force-pushed the debug-dashboard-daemon-stdio branch from 0a078e1 to dfa91ad Compare April 30, 2026 14:21
Daemon .err files live at daemon/${workspaceDirHash}/${session}.err, but the
flat readdir loop only saw the top-level entries, so they were never attached
on failure.
@Skn0tt Skn0tt force-pushed the debug-dashboard-daemon-stdio branch from dfa91ad to ad8d024 Compare April 30, 2026 14:25
@github-actions
Copy link
Copy Markdown
Contributor

Test results for "MCP"

4 failed
❌ [chrome] › mcp/dashboard.spec.ts:185 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest-chrome
❌ [chrome] › mcp/dashboard.spec.ts:207 › should enter annotate mode on fresh dashboard.tsx mount with -s annotate @mcp-windows-latest-chrome
❌ [chrome] › mcp/dashboard.spec.ts:231 › should annotate via direct browser_annotate MCP call @mcp-windows-latest-chrome
❌ [chrome] › mcp/dashboard.spec.ts:324 › should switch screencast to -s session on annotate @mcp-windows-latest-chrome

6856 passed, 927 skipped


Merge workflow run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant