Skip to content

tests: the drafter-auto benchmark test and two cluster bring-up tests stop flaking - #3750

Merged
ashhart merged 3 commits into
mainfrom
lead/ci-flakes-d937
Nov 20, 2026
Merged

ashhart merged 3 commits into
mainfrom
lead/ci-flakes-d937

Conversation

@ashhart

@ashhart ashhart commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Two test files caused most of the red PR CI runs this week (zig-b test-host-b) while main stayed green.

  • benchmark_run_test, "--drafter auto passes the family's drafter only when it is cached": the fake server sent its two stream events 15 ms apart, and a reader descheduled for longer read both at once, which the client counts as an unmeasured repeat (exit 2). The fake now spaces them so every read sees one event. On a starved core: 16 of 50 runs passed before, 50 of 50 after.
  • bringup_test, the two real-clock cluster tests: the leaver said goodbye before its peer's up() returned, and both raced a 120 ms suspect time on the real clock. bringup.Options gains a clock (the real one by default), and the two tests run on a lockstep clock. Under load: 96 of 100 before, 100 of 100 after.

Test-only, except the clock option, which defaults to today's behaviour. No engine output changes.

  • Synthena

…separate reads

benchmark_run_test's "--drafter auto passes the family's drafter only when it is cached ..." failed in PR CI with
"expected 0, found 2" (line 208, and on a loaded host line 200 too). Exit 2 is an unmeasured sample: benchmark_sse
counts a stream as measured only when its last text event arrived after its first (benchmark_sse.zig:143-146), and
benchmark_stream stamps an event with the time of the read that brought its line (benchmark_stream.zig:203). The
fake sent the first event, paused 15 ms, then the second (benchmark_fake.zig:258); a reader descheduled for longer
than that took both events in one read, with one timestamp.

fake.apart pads the first event with 1 MiB of SSE comment lines, more than the client's 576 KiB read buffer, so the
second event is always parsed from a later fill however late the reader runs. managedWorld and draftedWorld use it.
No engine code changes and every assertion stays.
…ep clock

bringup_test's "two ranks settle on the real clock and agree on one plan and view; a goodbye ends the other's watch
by name" and "a peer that stops after agreeing is found dead by name within the membership's dead time" failed on
busy runners. Both ran two ranks on the real clock with a 120 ms suspect time: a rank descheduled that long is
suspected by the other, and the views differ. In the first test, rank 0 also says goodbye as soon as its own up()
returns; when that goodbye reaches rank 1 before rank 1's up() returns, rank 1 reports a view without rank 0
(expected 5693255286640881692, found 3698603761711287178 at bringup_test.zig:97).

- bringup.Options gains a clock (bringup.Clock: now and pause); its default is fabric.words' monotonic clock and
  sleep, so Live behaves as before. up, watch and leave read it.
- The two tests drive both ranks on a Lockstep clock that advances only once every running rank waits, and the
  leaving rank says goodbye only after its peer's up() has returned. The first test's name says lockstep clock.
- The plan-mismatch, never-settled, wrong-peer and liar tests keep the real clock: they wait for a refusal or a
  deadline, not for two ranks to agree in time.

Every assertion stays.
@ashhart
ashhart force-pushed the lead/ci-flakes-d937 branch from d04c7f0 to 299ed8b Compare November 20, 2026 08:21
@ashhart
ashhart merged commit 83c25fa into main Nov 20, 2026
2 of 11 checks passed
@ashhart
ashhart deleted the lead/ci-flakes-d937 branch November 20, 2026 08:22
ashhart added a commit that referenced this pull request Nov 20, 2026
ashhart added a commit that referenced this pull request Nov 20, 2026
ashhart added a commit that referenced this pull request Nov 20, 2026
ashhart added a commit that referenced this pull request Nov 20, 2026
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