Skip to content

gitCommitInfoPlugin hangs the whole run on pull_request CI when origin credentials are unavailable (git fetch blocks in GCM prompt on Windows service accounts) #42630

Closed

Description

@pdingpding

Summary

On GitHub Actions pull_request runs, when the workspace has no usable origin credentials (e.g. actions/checkout with persist-credentials: false), the whole Playwright run hangs indefinitely before printing Running N tests. The process stays idle: near-zero CPU, no test workers spawned, no TCP connections, until the job timeout kills it.

Root cause

lib/plugins/gitCommitInfoPlugin.js → gitDiff(): when ci.prBaseHash is set (pull_request events only) and captureGitInfo.diff is enabled (the default in CI), it runs:

git fetch origin <base.sha> --depth=1 --no-auto-maintenance --no-auto-gc --no-tags --no-recurse-submodules

via spawnAsync(command, [], { stdio: "pipe", shell: true, timeout: GIT_OPERATIONS_TIMEOUT_MS }) with GIT_OPERATIONS_TIMEOUT_MS = 3000.

Without origin credentials, that fetch invokes the credential helper (Git Credential Manager). On a Windows self-hosted runner running as a service (session 0, e.g. NETWORK SERVICE) the credential prompt never resolves, and the 3s spawn timeout does not terminate the cmd → git → GCM grandchild chain, so the returned promise never settles. This is inside the pre-collection plugin setup task, so the run stalls permanently.

Evidence from a live stall (GitHub Actions self-hosted Windows runner, pull_request event):

  • DEBUG=pw:test* trace ends at pw:test:task "plugin setup" started (never finishes).
  • Node diagnostic report at +300s: event loop idle, 5 pipe/socket handles (stdio + the hung child), 0 active requests.

All other trigger types (workflow_dispatch/push/schedule) are unaffected because gitDiff returns early when ci.prBaseHash is absent — the hang is 100% correlated with pull_request + missing origin credentials.

Suggested fixes (any of)

  1. Reap the process tree on timeout on Windows (e.g. taskkill /T /F) or hard-abandon the promise when the timeout fires.
  2. Skip the fetch when the repo has no usable credentials / when persist-credentials: false can be detected (e.g. no http.<url>.extraheader and no credential helper configured).
  3. Fail fast with a clear error instead of hanging (the current failure mode is silent and extremely hard to diagnose).

Workaround

captureGitInfo: { diff: false } in the Playwright config disables the fetch entirely (commit info still works via local git log).

Environment

  • Playwright 1.5x (current), GitHub Actions, self-hosted Windows Server runner (NETWORK SERVICE, session 0), actions/checkout v6 with persist-credentials: false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions