Skip to content

Observed tests: wait for the restarted collector's init before reading it - #80

Open
HackTuah wants to merge 1 commit into
mainfrom
fix/restart-gap-flake
Open

HackTuah wants to merge 1 commit into
mainfrom
fix/restart-gap-flake

Conversation

@HackTuah

Copy link
Copy Markdown
Member

The floor leg failed once on #78's PR run ("a call during the restart gap is answered..."): snapshot/1 answered {:error, :not_started} right after the test found the restarted pid. GenServer registers the name before init/1 runs, and init/1 creates the table snapshot/1 reads, so the test could read in between.

Both restart tests now call the new process (:sys.get_state/1, answered only after init returns) before reading it. Evidence: with a 200 ms sleep forced into init/1, the old tests fail (both; the kill test had the same latent window) and the new ones pass; unmodified, 30 seeds, 0 failures. Test-only; local gate passes.

…g it (G-090)

The floor leg failed once in "a call during the restart gap is answered...": snapshot/1
answered {:error, :not_started} after the loop had found the restarted pid. GenServer
registers the name before init/1 runs, and init/1 creates the table snapshot/1 reads, so a
poll on the name can land between the two; the floor runner is slow enough to. Both restart
tests now make a call to the new process (:sys.get_state/1, answered only after init returns)
before reading it. Measured: with a 200 ms sleep put into init/1 before the table, the old
tests fail (both of them: the kill test had the same window, latent) and the new ones pass;
unmodified, 30 seeds, 0 failures. No package change: the gap is the collector's documented
restart gap, and it ends when init returns.

Signed-off-by: Ayla Croft <aylacroft@proton.me>
@HackTuah
HackTuah requested a review from minitru September 26, 2026 19: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