Skip to content

test: make default-timeout test deterministic across environments#15

Merged
suin merged 1 commit intomainfrom
fix/flaky-default-timeout-test
Apr 13, 2026
Merged

test: make default-timeout test deterministic across environments#15
suin merged 1 commit intomainfrom
fix/flaky-default-timeout-test

Conversation

@suin
Copy link
Copy Markdown
Contributor

@suin suin commented Apr 13, 2026

Summary

  • ts/default-timeout.test.ts was flaky on CI. It counted occurrences of timed out after 100ms in the combined stderr of a single bun test file1 file2 run and asserted the count was exactly 2.
  • Bun prints failure messages in two places (inline error and end-of-run summary), and whether the summary block appears depends on platform / output mode. Locally (macOS) the regex matched 2 times; on Linux CI it matched 4, causing Expected length: 2 / Received length: 4.
  • Fix: spawn each fixture file separately and assert exitCode !== 0 and stderr contains timed out after 100ms per file. This verifies the real invariant — each file independently times out at KEST_DEFAULT_TIMEOUT — without depending on output formatting.

Test plan

  • bun test ts/default-timeout.test.ts passes locally
  • devbox run -- task ci passes locally
  • CI passes on this PR

🤖 Generated with Claude Code

Counting occurrences of "timed out after 100ms" in combined stderr was
flaky: Bun sometimes prints the failure message twice per file (once
inline, once in the summary block), depending on platform and output
mode. Locally the regex matched 2 times; on Linux CI it matched 4.

Spawn each fixture file separately and assert exit code and stderr
content per file instead. This verifies the essential invariant — each
file independently times out at KEST_DEFAULT_TIMEOUT — without
depending on output formatting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@suin suin merged commit 68f7731 into main Apr 13, 2026
1 check passed
@suin suin deleted the fix/flaky-default-timeout-test branch April 13, 2026 13:31
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