Skip to content

[cleanup]Parallelize pure agent tests#1406

Open
stale2000 wants to merge 1 commit into
entireio:mainfrom
stale2000:stale2000/tighten-agent-test-parallelization-v3
Open

[cleanup]Parallelize pure agent tests#1406
stale2000 wants to merge 1 commit into
entireio:mainfrom
stale2000:stale2000/tighten-agent-test-parallelization-v3

Conversation

@stale2000

@stale2000 stale2000 commented Jun 10, 2026

Copy link
Copy Markdown

Entire logs: https://entire.io/gh/stale2000/cli/session/019eb34d-b79e-7371-b8c1-9171962a02ed

Issue

A rough scan found thousands of Go tests in the repo, with a noticeable gap between top-level tests and t.Parallel() coverage. Some omissions are intentional because tests mutate process-global state (t.Chdir, t.Setenv, subprocess environment, hook installation), but several agent-package parser/table tests are pure and were still running serially.

Fix

This PR adds t.Parallel() only to conservative, low-risk agent tests:

Area Why it is safe
agent interface/constant tests Pure value/interface checks
agent chunking tests Local byte/string transformations
agent session helper tests In-memory session structs
geminicli parser/session/chunking tests Temp-file or in-memory cases, avoiding env/CWD tests
claudecode transcript helper tests Pure token/spawned-agent parsing

Tests that use process-global state or helper-hidden env/CWD mutation were left serial.

Benefit

Benchmark scope Result
Focused touched packages, median 0.6% faster
Focused touched packages, mean 2.1% faster
Full agent subtree No reliable suite-wide speedup measured

The honest benefit is a modest focused-package improvement today, plus less serial drag as these pure tests accumulate over time.

Verification

  • go test ./cmd/entire/cli/agent ./cmd/entire/cli/agent/geminicli ./cmd/entire/cli/agent/claudecode
  • mise run lint

Recreated from upstream main for the v3 branch so the branch has a fresh commit object while preserving the reviewed test-only changes.

Constraint: User requested a fresh SHA on a branch based directly on upstream main

Rejected: Reuse 6129201 | Entire commit-history cache stayed pending for branches pointing at that SHA

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: Keep t.Parallel only in pure tests; avoid CWD/env/global-state tests

Tested: go test ./cmd/entire/cli/agent ./cmd/entire/cli/agent/geminicli ./cmd/entire/cli/agent/claudecode

Not-tested: Full mise run check

Entire-Checkpoint: 490d8a478629
@stale2000 stale2000 requested a review from a team as a code owner June 10, 2026 21:47
@stale2000 stale2000 changed the title Parallelize pure agent tests [cleanup]Parallelize pure agent tests Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant