The node-engine's self-compose test lets no goroutine outlive a setting it reads (fix-a-bug-met-twice) #247

Merged
mesh-tools merged 3 commits from fix/47-H1-selfcompose-races into main 2026-11-21 22:07:14 +00:00
3 Commits
Author SHA1 Message Date
jschoubben ed8aa83475 End the composer's loop before its settings are restored
fix-a-bug-met-twice, the same kind as the shadows: the composer's loop of
TestTheNodeComposesItsWantsFromTheBus ran on, until the deferred cancel,
past the cleanup that restores composeAgain, laterAgain, passSaysEvery and
slowAfter, which its passes read. The test now cancels it and waits for its
out to close first. -race -count=50: 50 of 50, no race.

Suspected, not fixed: the flake "the composer handed n1.tool.7777..., and
nothing changed" (trunk line 691, 1 of 60 at review, 0 of 200 here), I
think a compose-again pass handing a composition late after the issue 1966
step.

Builds: design 47 H H-A-312
2026-11-21 22:46:55 +01:00
jschoubben 6594409084 Wait for the shadow's settled answer and end the second shadow before its setting is restored
fix-a-bug-met-twice, the kind: TestTheNodeComposesItsWantsFromTheBus
asserted on output its composer and shadows still produced, or let their
goroutines outlive a setting they read. The groups' answers are now waited
for until every group is answered as it should be, not read from whichever
answer came first (which flaked, and the settled one then read as handed
again for nothing changed); the second shadow is ended before the test's
cleanup restores notReadyAfter. Carries the ghost-entry order and the first
shadow's end from the packet filter branch.

Builds: design 47 H H-A-312
2026-11-21 22:43:14 +01:00
jschoubben b113e57c6c Order the ghost's entry case and end the first shadow before its setting changes
Review round 2 (2), fix-a-bug-met-twice: the ghost's entry was answered at
once, so a pass could read it entry-missing before the assertion read
entry-asked; its answer now waits until the assertion has read. The 250 ms
real sleep before compose now is gone: askedWithin is set to none, then to
an hour for the ask made again at once. The first shadow ran on while
notReadyAfter was set for the next step, a data race; it is ended first.

Builds: design 47 H H-A-312
2026-11-21 22:26:52 +01:00