Skip to content

fix(headless): avoid cross-test chrome teardown races#7053

Merged
dwisiswant0 merged 1 commit intodwisiswant0/chore/go-fixfrom
dwisiswant0/fix/headless/avoid-cross-test-chrome-teardown-races
Feb 27, 2026
Merged

fix(headless): avoid cross-test chrome teardown races#7053
dwisiswant0 merged 1 commit intodwisiswant0/chore/go-fixfrom
dwisiswant0/fix/headless/avoid-cross-test-chrome-teardown-races

Conversation

@dwisiswant0
Copy link
Member

Proposed changes

Drop global Chrome process sweeping from browser
shutdown.

The previousPIDs snapshot + delta kill logic is
unsafe on shared/parallel runners: a test can
classify another test's Chrome as "new" and kill
it during (*Browser).Close(), triggering
intermittent Rod panics (use of closed network
connection).

Proof

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Drop global Chrome process sweeping from browser
shutdown.

The `previousPIDs` snapshot + delta kill logic is
unsafe on shared/parallel runners: a test can
classify another test's Chrome as "new" and kill
it during `(*Browser).Close()`, triggering
intermittent Rod panics (use of closed network
connection).

Signed-off-by: Dwi Siswanto <git@dw1.io>
@auto-assign auto-assign bot requested a review from Mzack9999 February 27, 2026 02:49
@neo-by-projectdiscovery-dev
Copy link

neo-by-projectdiscovery-dev bot commented Feb 27, 2026

Neo - PR Security Review

No security issues found

Highlights

  • Removes global Chrome process sweeping (previousPIDs snapshot + delta kill logic) from Browser.Close() to prevent race conditions in parallel test runners
  • Proper cleanup still occurs via launcher.Kill() and engine.Close() methods
  • Test helper function maintains deferred cleanup for browser and instance resources

Comment @neo help for available commands. · Open in Neo

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dwisiswant0/fix/headless/avoid-cross-test-chrome-teardown-races

Comment @coderabbitai help to get the list of available commands and usage tips.

@dwisiswant0
Copy link
Member Author

@coderabbitai create an issue for this, and linked to this PR.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@dwisiswant0: I'll create a GitHub issue for this PR right away.


🏁 Script executed:

#!/bin/bash
# Create a GitHub issue for the cross-test chrome teardown races problem

gh issue create \
  --repo projectdiscovery/nuclei \
  --title "fix(headless): avoid cross-test chrome teardown races" \
  --body "## Problem

The \`previousPIDs\` snapshot + delta kill logic in browser shutdown is unsafe on shared/parallel runners. When tests run concurrently, a test can classify another test's Chrome process as \"new\" and kill it during \`(*Browser).Close()\`, triggering intermittent Rod panics due to use of closed network connections.

## Context

This issue is being addressed in PR `#7053` by removing global Chrome process sweeping from browser shutdown.

## References

- Pull Request: https://github.com/projectdiscovery/nuclei/pull/7053
- Requested by: `@dwisiswant0`" \
  --assignee dwisiswant0

Length of output: 54


@dwisiswant0: I've successfully created issue #7057 for this PR. The issue describes the cross-test Chrome teardown race condition problem and references PR #7053. It has been assigned to you as requested.

@dwisiswant0
Copy link
Member Author

Dismissing the review. Merging into #7018.

@dwisiswant0 dwisiswant0 merged commit 1556d08 into dwisiswant0/chore/go-fix Feb 27, 2026
19 checks passed
@dwisiswant0 dwisiswant0 deleted the dwisiswant0/fix/headless/avoid-cross-test-chrome-teardown-races branch February 27, 2026 03:58
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.

[MAINTENANCE] intermittent Rod panics due to use of closed network connections

1 participant