Skip to content

[deep-report] 10 Go test files use hardcoded time.Sleep without t.Parallel(), including fragile mtime-differentiation sleeps #64824

Description

@github-actions

Description

10 Go test files call time.Sleep for synchronization/timing purposes without t.Parallel(), serializing wall-clock time that could otherwise overlap and making the tests fragile on slow filesystems/CI runners:

  • pkg/console/spinner_test.go (7 sleeps — most sleep-heavy file)
  • pkg/cli/compile_context_cancellation_test.go (3)
  • pkg/cli/run_push_test.go (3 — three 100ms sleeps)
  • pkg/workflow/compiler_skip_write_test.go (3 — three 100ms sleeps used purely to separate file mtimes)
  • pkg/cli/mcp_inspect_inspector_test.go (2)
  • pkg/cli/logs_orchestrator_test.go, pkg/cli/compile_integration_test.go, pkg/cli/logs_summary_integration_test.go, pkg/workflow/compiler_test.go, pkg/logger/logger_test.go (1 each)

The compiler_skip_write_test.go and run_push_test.go cases are the clearest wins: both use a hardcoded 100ms sleep three times purely to force distinguishable file-modification timestamps between writes, rather than asserting on content/hash directly or using a monotonic clock injection — a pattern that is both slow (300ms+ serial per test) and theoretically flaky on filesystems with coarser mtime resolution.

Expected Impact

Adding t.Parallel() where the test body has no shared mutable state lets these tests overlap instead of serializing, and replacing the two hardcoded mtime-differentiation sleeps with direct content/hash assertions (or an injectable clock) removes both the wall-clock cost and the filesystem-timing fragility.

Suggested Agent

GitHub Copilot coding agent (test-only change: add t.Parallel() to the 10 listed files where safe, and refactor the two mtime-differentiation sleep patterns in compiler_skip_write_test.go/run_push_test.go).

Estimated Effort

Quick (< 1 hour) for the t.Parallel() additions; the two mtime-sleep refactors are closer to Medium given they touch assertion logic.

Data Source

DeepReport Intelligence Briefing — 2026-10-01, sourced from Repository Quality Improvement Report #64772 ("Uncancellable Sleep & Sleep-Based Test Synchronization"), file list independently re-verified via grep -rl time.Sleep --include=*_test.go pkg/ cross-checked against t.Parallel() presence.

Generated by 🔬 Deep Report · claude · agent · 302 AIC · ⌖ 15.3 AIC · ⊞ 7.3K · ◷

  • expires on Oct 3, 2026, 10:45 AM UTC-08:00

Activity

  1. github-actions commented on Oct 3, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-10-03T18:45:48.616Z.

    Closed by Workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions