Skip to content

flaky: tests/unit/hub-selection.test.ts times out on Windows CI runners #2368

Closed

Description

@carlos-alm

Problem

tests/unit/hub-selection.test.ts has hit a 30000ms timeout on the Test Node 22 (windows-2022) CI job twice in consecutive, otherwise-unrelated PRs during this /fixer batch run:

Both PRs' changes are structurally incapable of affecting this test file's behavior (a Markdown badge edit and a lockfile-only chore), and both reruns passed cleanly on retry — strongly indicating Windows-runner-specific flakiness (slow tmpdir I/O, antivirus scanning overhead, or similar), not a real regression. The overall Windows test run duration in both cases was ~485-495s, close to whatever margin exists before hitting the default 30s per-test/per-hook timeout.

Fix direction

Options to evaluate:

  • Increase this file's beforeAll/test timeout via a per-file { timeout: ... } override (matching how other Windows-sensitive tests in this repo already handle slow I/O — check for precedent).
  • Investigate whether tests/unit/hub-selection.test.ts's beforeAll does something Windows-specifically slow (temp directory creation via fs.mkdtempSync, DB file creation) that could be sped up.
  • If neither is tractable, add this test file to a documented "known-flaky on windows-2022" allowlist so future /fixer or CI runs don't need to independently rediscover and rerun it.

Filed since two independent, otherwise-clean PRs in the same session hit this — not something either of those PRs' own diffs could have caused.

Activity

  1. carlos-alm commented on Aug 9, 2026

    @carlos-alm
    ContributorAuthor

    Third occurrence — PR #2379 (docs-only change to CLAUDE.md's Parallel Sessions section, no code/test files in the diff). Same test, same line, same failure mode:

    FAIL tests/unit/hub-selection.test.ts > selectHubTargets > throws when the graph has no qualifying nodes with edges
    Error: Test timed out in 30000ms.
     ❯ tests/unit/hub-selection.test.ts:129:3
    

    Run: https://github.com/optave/ops-codegraph-tool/actions/runs/31303329326/job/93220684433 (Test Node 22, windows-2022). Total Windows run duration was 467.27s, and several other tests in the same run's tracer-validation.test.ts came within ~20ms of their own 60s timeouts (60020ms), same pattern as the prior two occurrences — the whole runner was under heavy contention, not this test's own logic being slow (it's a fully synchronous better-sqlite3 query against an empty on-disk DB). Re-running the job to confirm; will report back. Three occurrences in as many days on unrelated PRs seems worth prioritizing the beforeAll/per-test timeout bump mentioned in the fix direction above.

  2. carlos-alm commented on Aug 9, 2026

    @carlos-alm
    ContributorAuthor

    Confirmed — rerun of just the failed job (gh run rerun --failed) passed cleanly: Test Node 22 (windows-2022) completed in 16m23s with all 4778 tests passing. Same pattern as the first two occurrences. PR #2379 is otherwise unaffected and CI is now fully green.

  3. added a commit that references this issue on Aug 14, 2026
    d242aa7
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