Skip to content

fix(tests): add AbortSignal timeouts to thread-management integration suite#762

Open
kriszyp wants to merge 3 commits into
mainfrom
fix/thread-management-test-flakiness
Open

fix(tests): add AbortSignal timeouts to thread-management integration suite#762
kriszyp wants to merge 3 commits into
mainfrom
fix/thread-management-test-flakiness

Conversation

@kriszyp
Copy link
Copy Markdown
Member

@kriszyp kriszyp commented May 23, 2026

Summary

  • Adds signal: AbortSignal.timeout(5000) to every fetch call in the thread-management integration test suite via an opsRequest helper
  • Adds { timeout: 15000 } to each test() call so a slow Windows runner can't spin indefinitely
  • Extracts authHeader/opsRequest helpers to remove repeated Base64 boilerplate

Root cause

On Windows CI, fetch() calls without an AbortSignal can hang if Harper is momentarily unavailable between "successfully started" and the operations API actually accepting connections. With 20 concurrent requests outstanding and no timeout, the node:test child process produces no TAP output and the parent runner surfaces it as a cryptic file:1:1 'test failed' rather than a specific assertion error. Adding AbortSignal.timeout ensures failures produce a clear AbortError with a meaningful message.

Test plan

  • Integration Tests 2/4 (Windows, Node.js v24) passes (the shard that previously contained the flaky failure)
  • All other integration test shards continue to pass

kriszyp and others added 2 commits May 22, 2026 21:58
…management suite

Fetch calls had no timeout, so a slow or unavailable Harper instance on
Windows could leave them hanging indefinitely — causing the test subprocess
to produce no TAP output and surface as a cryptic file:1:1 failure.

Add AbortSignal.timeout(5000) to every fetch and { timeout: 15000 } to each
test so failures produce a clear message instead of a silent process crash.
Also extract authHeader/opsRequest helpers to remove the duplicated Basic-auth
encoding.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 23, 2026

Reviewed; no blockers found.

…y tests

After await concurrentWrites, all puts have committed but their subscription
events may still be queued as async callbacks. Calling subscription.return()
immediately can close the stream before those callbacks fire, silently
dropping the last write(s). Adding await delay(200) gives pending events
time to arrive so the assertions see all committed ids.

Fixes the intermittent "missing concurrent id N" failure in the startTime,
count, and !omitCurrent concurrent-write tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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