GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: exclude crawler-e2e siblings from #[serial] env swaps via #[parallel] by mikolalysenko · Pull Request #136 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

What this sweep found

#135 fixed the setup-matrix decoy race and documented the gotcha: #[serial] only excludes other #[serial] tests. Sweeping every test binary in both crates with a helper-aware analyzer (attributes each test's mutation status including mutation hidden inside helpers like crawler_npm_e2e::with_empty_path) found the same hazard at much larger scale:

binary tests #[serial] mutators unmarked siblings
crawler_npm_e2e 58 4 54
crawler_python_e2e 43 12 31
crawler_cargo_e2e 32 3 29
crawler_maven_e2e 28 8 20
crawler_go_e2e 24 7 17
crawler_composer_e2e 21 5 16
crawler_nuget_e2e 28 13 15
crawler_ruby_e2e 20 7 13
crawler_deno_e2e 13 5 8
cli_global_args 14 12 2

The serial tests swap HOME, VIRTUAL_ENV, PATH, XDG dirs, and (composer) the process cwd around in-process crawler calls. Unlike #135's child-spawn snapshot race (microseconds window), this variant exposes siblings for the mutator's entire body: any concurrently-running sibling whose crawl probes HOME-based global caches mid-swap sees the wrong universe. All mutating tests were already #[serial] — the gap was solely their unmarked siblings.

The fix

#[serial_test::parallel] on all 205 unmarked siblings. Parallel-marked tests keep running concurrently with each other but take the shared side of serial_test's lock, so they're excluded while any #[serial] test runs — suite wall-times are unchanged (verified: all ten binaries' runtimes identical before/after; 280 tests green).

Blanket #[serial] (the #135 approach, right for those tiny suites) would have serialized 58-test binaries for no reason.

Mechanism proven RED/GREEN

Throwaway probe pair (not committed): a #[serial] test swapping HOME for 150ms alongside an unmarked sibling asserting HOME stays stable — fails 3/3 runs with "HOME changed mid-test"; after marking the sibling #[parallel], passes 5/5. Same primitive as #135's deterministic proof, in-process variant.

Not touched

Single-test binaries with env mutation (e2e_golang_build, setup_matrix_env_guard) — no siblings, no intra-process race.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko @claude
test: exclude crawler-e2e siblings from #[serial] env swaps via #[par…
a97507f
…allel]

Follow-up to #135, which fixed the hostile-decoy env race in the
setup-matrix suites and documented the gotcha this sweep now applies
repo-wide: #[serial] only excludes OTHER #[serial] tests. Nine
crawler_*_e2e binaries (and cli_global_args) have #[serial] tests that
swap process-global state — HOME, VIRTUAL_ENV, PATH, XDG dirs, even the
process cwd (composer) — around in-process crawler calls, while dozens
of unmarked sibling tests run concurrently on other threads. Unlike
#135's child-spawn snapshot race (a microseconds window), the in-process
variant exposes siblings for the mutator's entire body: any sibling
whose crawl probes HOME-based global caches mid-swap sees the wrong
universe.

A helper-aware sweep of every test binary in both crates confirmed all
MUTATING tests are already #[serial] (including mutation hidden inside
helpers like crawler_npm_e2e's with_empty_path); the gap was solely the
unmarked siblings. Fix: #[serial_test::parallel] on all 205 of them —
parallel-marked tests keep running concurrently with each other but are
excluded while any #[serial] test holds the lock, so suite wall-time is
unchanged (binaries' runtimes identical before/after).

Mechanism proven RED/GREEN with a throwaway probe pair (not committed):
a #[serial] test swapping HOME for 150ms + an UNMARKED sibling asserting
HOME stays stable fails 3/3 runs; marking the sibling #[parallel] passes
5/5. Same primitive as #135's proof, in-process variant.

Single-test binaries with env mutation (e2e_golang_build,
setup_matrix_env_guard) have no intra-process race and stay untouched.

Co-Authored-By: Claude Fable 5 <[email protected]>
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge (squash) July 27, 2026 18:25
marvinsocket
marvinsocket approved these changes Jul 27, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit 72c07e9 into main Jul 27, 2026
54 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the fix/crawler-e2e-parallel-guard branch July 27, 2026 18:35
@jdalton John-David Dalton (jdalton) mentioned this pull request Aug 2, 2026
test(cli): give the Rust test suite its own package-manager caches #143
Closed
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Aug 5, 2026
test: hermetic package-manager caches — squash of #142/#143/#144 + review fixes + hosted-e2e unblock #146
Merged
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Sep 27, 2026
Support vlt in hosted, vendored and agent modes #269
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@marvinsocket marvinsocket marvinsocket approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikolalysenko @marvinsocket
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.