Skip to content

Conversation

@TaprootFreak
Copy link
Collaborator

@TaprootFreak TaprootFreak commented Jan 2, 2026

Summary

  • Replace timing-based test with Promise-based synchronization
  • The original test used setTimeout without delay causing race conditions
  • New test uses explicit Promise signaling for deterministic behavior - no timing dependencies

Changes

The old test relied on timing (Util.delay(10) vs Util.delay(1)) which could fail under CI load.
The new test uses Promise-based coordination:

  1. First lock signals when acquired via lockHeld Promise
  2. Test waits for signal before attempting second lock
  3. First lock waits for releaseFirstLock() before completing

Test plan

  • Test passes consistently (verified 10/10 runs locally)
  • All other tests still pass (48 passed, 1 skipped)
  • No timing dependencies - fully deterministic

Replace timing-based test with Promise-based synchronization.
The original test used setTimeout without delay causing race conditions.
The new test uses explicit Promise signaling for deterministic behavior.
@TaprootFreak TaprootFreak force-pushed the fix/flaky-lock-timing-test branch from 3030f8c to 17aadd5 Compare January 2, 2026 12:41
@TaprootFreak TaprootFreak merged commit 5a55525 into develop Jan 2, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the fix/flaky-lock-timing-test branch January 2, 2026 13:05
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