Files
magpie/internal
yetone fa23329769 gateway tests: an unrouted 504 test waits for its held report before it ends
TestUnroutedUnknownHoldAnsweredSooner failed on mote (10-29) with
"TempDir RemoveAll cleanup: unlinkat …/magpie/held: directory not
empty". The 504 is answered first and the held report is written after
it (unrouted.go), so a test that returns on the 504 alone races the
write against its TempDir's removal. TestUnroutedHeldReportSaved
already waited for the route's Held; the three others that end on an
unrouted 504 (UnknownHoldAnsweredSooner, RequestShownThenAnswered,
MostLeavesOutMasking) now wait too, through heldSaved, for any
probe/text route naming its report (once let go, the request may begin
a route of its own beside the one shown).

Run (mote): the four unrouted/held tests -count=3 with a 300ms sleep
injected before writeHeld: ok; full ./internal/gateway in the previous
commit's record.
Broken by hand: not reproduced red. With the injected sleep the old
tests still pass, since the late write lands after RemoveAll and
recreates the folder rather than racing it; the cause is from the log
and the code, not a forced red.

At this head (both commits rebased on origin/main adc618bbf), on mote: go vet,
GOOS=windows go vet and GOOS=linux go vet -tags nogui of
./internal/gateway ./internal/provider clean; go test -count=1
./internal/provider ok; ./internal/gateway -run
'Factory|Refus|Policy|Unrouted|Held' ok. The full ./internal/gateway
run (ok, 768s) was at the earlier base 96a703a59.
Rebased once more onto fc43c69e5 (Codex effort change: codex_backend,
decide, effort_update, gateway, quiet, responses; none of the files
here) after that run; not run again on it.
2026-10-29 18:31:42 +08:00
..
…
…
…
…
…
…