Skip to content

Disable parse timeout in tests#16

Merged
andrew merged 1 commit into
mainfrom
disable-parse-timeout-in-tests
Jul 7, 2026
Merged

Disable parse timeout in tests#16
andrew merged 1 commit into
mainfrom
disable-parse-timeout-in-tests

Conversation

@andrew

@andrew andrew commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

TestOutlineSwift is flaky on macos-latest under -race: the Swift tree-sitter grammar is slow enough that parsing the 15-line fixture brushes the 1s DefaultParseTimeout, and runner jitter tips it into ParseStoppedEarly()Outline() returns ok=false → test fails with Sample.swift: not supported.

Recent macOS timings for that test across CI runs: 0.87s, 0.87s, 1.01s, 1.29s, 1.34s, 1.47s (fail), 1.55s, 2.37s (fail). Main is currently red with this.

The timeout exists to keep pathological real-world inputs from dominating a Pack run; it has no business gating unit tests on tiny fixtures. Add a TestMain that calls SetParseTimeout(0) before the suite runs so correctness tests aren't also timing tests. The overall go test timeout still catches a genuine hang.

The per-file parse timeout exists to keep pathological real-world
inputs from dominating a Pack run. Test fixtures are tiny and should
never hit it, but on macOS CI runners under -race the Swift grammar
has been observed to brush the 1s default and intermittently trip
ParseStoppedEarly, failing TestOutlineSwift with 'not supported'.

Recent macOS timings for TestOutlineSwift: 0.87s, 0.87s, 1.01s, 1.29s,
1.34s, 1.47s (fail), 1.55s, 2.37s (fail).

Set the timeout to 0 in TestMain so correctness tests aren't also
timing tests. The overall go test timeout still catches real hangs.
@andrew andrew merged commit 9207cc5 into main Jul 7, 2026
7 checks passed
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.

1 participant