Skip to content

chore: Stop observing in the tests once the expected events arrived, instead of after a fixed time. - #428

Merged
goloroden merged 2 commits into
mainfrom
chore/stop-observing-once-events-arrived
Oct 19, 2026
Merged

goloroden merged 2 commits into
mainfrom
chore/stop-observing-once-events-arrived

Conversation

@goloroden

Copy link
Copy Markdown
Member

Four tests in src/observeEvents.test.ts aborted observing after a fixed 100 ms and then counted the events, so under load they could stop before the events arrived.

  • They now stop once the expected number of events has arrived.
  • An outer bound of 10 seconds ends observing if an event is missing, and the test then fails with "Observed 2 of 3 events within 10000 milliseconds." instead of hanging.
  • The test for an empty database keeps its 100 ms window, since it checks that nothing arrives.

The file passed 15 times in a row and 10 times with every core busy (load average around 30).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QykegdHe7vhHMBN3kWxgfH

…instead of after a fixed time.

Four tests of observeEvents aborted observing after 100 milliseconds and then
counted the events, so on a busy machine they could stop before the events
arrived. They now stop once the expected number of events has arrived, and
fail with the number they observed if the events have not arrived within 10
seconds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QykegdHe7vhHMBN3kWxgfH
@goloroden
goloroden requested a review from a team as a code owner October 19, 2026 15:46
@goloroden goloroden self-assigned this Oct 19, 2026
@goloroden
goloroden merged commit 2fbedef into main Oct 19, 2026
3 checks passed
@goloroden
goloroden deleted the chore/stop-observing-once-events-arrived branch October 19, 2026 16:38
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