Skip to content

test(plugins): read the CSP probe's result path from its config, not argv's tail - #37329

Merged
nwparker merged 1 commit into
mainfrom
nwparker/fix-csp-electron-linux
Nov 2, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/fix-csp-electron-linux

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3
Prod 0 0 0 0

Why

src/main/plugins/panels/plugin-frame-blocked-requests.electron.test.ts, added in #37300, has failed on every Linux run since: the last run of #37300 itself (41386993736), and main pushes 41388813032 and 41389106099. Each fails with Error: timeout and no result. It passes on macOS.

The probe's main script found its config as process.argv[process.argv.length - 2]. On Linux, resolveElectronProbeLaunch appends --no-sandbox, so that slot holds the --user-data-dir=… flag. The script then wrote result.json under a directory named after the flag. That write threw inside the console-message handler, so Electron never exited and the launcher killed it at 30s. A diagnostic run (#37325, closed) added a 15s fallback write, and it never landed either, which confirms the write path, not the CSP messages, was the problem.

Change

The sibling Electron probes (plugin-frame-guest-clipboard, plugin-frame-guest-egress) already read resultPath from config.json at argv[2]. This probe now does the same. The assertions are unchanged.

Testing

  • The test passes locally on macOS.
  • Linux CI unit shards run it on this PR.

…argv's tail

On Linux the probe launcher appends --no-sandbox, so argv[length - 2] is the --user-data-dir flag rather than the config path. The page then wrote result.json under a directory named after that flag, threw, never exited, and the launcher timed it out at 30s on every Linux run since #37300. The sibling Electron probes already pass the result path in config.json; this one now does too.
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9a8d76a6-7e13-4cbc-964c-e67aa979c96a
Commits

Reviewing files that changed from the base of the PR and between 0881375 and 0d03a49.

Files selected for processing: 1
  • src/main/plugins/panels/plugin-frame-blocked-requests.electron.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

The Electron test now writes the expected result path to config.json. The Electron script reads resultPath from the JSON configuration file named by process.argv[2]. It no longer derives the result path from process.argv positions.

Merge Risk: Minimal · up to 0d03a

The Electron test’s configuration and result-file flow is consistent across supported platforms.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: the test now reads the CSP probe's result path from its config file instead of the tail of argv. It is specific and matches the raw summary and the PR objectives. It u…
Description check Passed The description is mostly complete and follows the template's main content. It covers the cause (argv[length - 2] picks up the --user-data-dir flag when --no-sandbox is appended on Linux), the change …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the test now reads the CSP probe's result path from its config file instead of the tail of argv. It is specific and matches the raw summary and the PR objectives. It uses the conventional type(scope) prefix, and at 80 characters it is slightly long but still a single clear sentence.

Full details: Description check

Explanation

The description is mostly complete and follows the template's main content. It covers the cause (argv[length - 2] picks up the --user-data-dir flag when --no-sandbox is appended on Linux), the change (read resultPath from config.json at argv[2], as the sibling probes do), and testing (passes on macOS, Linux CI shards run it). Gaps: the ELI5, Visual Proof (N/A with reason), Risk level, Linked Issue ("Fixes #" is blank; the PR cites #37300 and #37325 as context, not as a linked issue), and the Testing checklist and the agent-skill boundary are not filled in. The description does not state a user-facing before/after or a backout plan.

Resolution

Optional but recommended: add an ELI5 line, mark Visual Proof as N/A with a reason, set the Risk level and backout plan (a plain revert is likely enough), and fill in the Linked Issue section or confirm that a maintainer exemption applies. Tick the Testing and agent-skill checkboxes as applicable.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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