Skip to content

test: set a 5s repo-wide unit-suite timeout floor - #2135

Merged
rugpanov merged 3 commits into
mainfrom
test/unit-suite-default-timeout
Aug 21, 2026
Merged

test: set a 5s repo-wide unit-suite timeout floor#2135
rugpanov merged 3 commits into
mainfrom
test/unit-suite-default-timeout

Conversation

@rugpanov

Copy link
Copy Markdown
Contributor

Why

The unit suite builds Mocha with only ui/color, so mocha's 2 s default applies. On cold CI runners (AV scan + cold FS cache) a test's first real I/O can exceed 2 s, and the penalty attaches to whichever spawn test the glob happens to run first — an unstable contract, since adding or renaming a file under src/ migrates the flake to the next spawn test. Raising the timeout per-file only chases the class one file at a time (this was the follow-up flagged in review of #2134).

What

Set timeout: 5000 on the shared Mocha instance in src/test/suite.ts. 5 s clears the cold-runner I/O spike while staying tight enough to fail a genuine hang fast. Tests that spawn the real CLI keep their own higher overrides (CliWrapper.test.ts 10 s, the packaging smoke describe 30 s), which still win per-suite.

Verification

  • yarn test:unit — 877 passing, 0 failing.
  • eslint + prettier clean.

This pull request and its description were written by Isaac.

*Why*

The unit suite builds Mocha with only `ui`/`color`, so mocha's 2s default
applies. On cold CI runners (AV scan + cold FS cache) a test's first real I/O
can exceed 2s, and the penalty attaches to whichever spawn test the glob happens
to run first — an unstable contract, since adding or renaming a file under
`src/` migrates the flake to the next spawn test. Raising the timeout on
individual files only chases the class one file at a time.

*What*

Set `timeout: 5000` on the shared Mocha instance in `src/test/suite.ts`. 5s
clears the cold-runner I/O spike while staying tight enough to fail a genuine
hang fast. Tests that spawn the real CLI keep their own higher overrides
(CliWrapper 10s, the packaging smoke describe 30s), which still win per-suite.

*Verification*

- `yarn test:unit` — 877 passing, 0 failing.
- `yarn fix` clean.

Co-authored-by: Isaac
@rugpanov
rugpanov deployed to test-trigger-is August 20, 2026 08:38 — with GitHub Actions Active
@rugpanov
rugpanov deployed to test-trigger-is August 20, 2026 08:38 — with GitHub Actions Active
@rugpanov

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests triggered for 11c66e48 — ⏳ running.
View run

*Why*

Review of the 5s timeout floor flagged two comment nits: the new suite.ts
comment narrated mechanism beyond the load-bearing why (CODE_CONVENTIONS §4b),
and a pre-existing shellUtils.test.ts comment justified its 60s override against
"the 2s default", which this change makes stale.

*What*

- Trim the suite.ts timeout comment to the why plus the one fact worth stating
  (per-suite this.timeout() still overrides the floor); drop the mechanism
  narration and the rot-prone file reference.
- Drop the specific "2s" from the shellUtils.test.ts comment so it doesn't lie
  once the repo-wide default is 5s.

*Verification*

- `yarn test:unit` — 877 passing, 0 failing.
- `yarn fix` clean.

Co-authored-by: Isaac
@rugpanov
rugpanov deployed to test-trigger-is August 20, 2026 08:55 — with GitHub Actions Active
@rugpanov
rugpanov marked this pull request as ready for review August 20, 2026 08:57
@rugpanov
rugpanov deployed to test-trigger-is August 20, 2026 08:58 — with GitHub Actions Active
@rugpanov

rugpanov commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ✅ all 41 test jobs passed for 24d1197b.
View run

@rugpanov
rugpanov enabled auto-merge (squash) August 21, 2026 06:23
@rugpanov
rugpanov deployed to test-trigger-is August 21, 2026 06:24 — with GitHub Actions Active
@rugpanov
rugpanov merged commit fbafbbe into main Aug 21, 2026
6 checks passed
@rugpanov
rugpanov deployed to test-trigger-is August 21, 2026 06:24 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2135
  • Commit SHA: 5c0a81e825e7126839c42200751e18ef25faa9d3

Checks will be approved automatically on success.

@github-actions github-actions Bot mentioned this pull request Aug 21, 2026
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.

2 participants