TestMaxRPMAgentGoneWhileWaiting went red on ubuntu CI at 588f87a12
("1 still waiting for room after the agent went"). On a cancel, wait gave
the place back first and stopped its timer only in a defer after, so the
test could see the place back while the wait was still registered. The
wait now stops its timer, then gives the place back.
Run:
- Injected a 100ms pause after giveBack: the old order is red 3 of 3,
the new order green 3 of 3.
- go test -race -run TestMaxRPM -count=10 ./internal/gateway: ok.
- go test ./... -count=1 -timeout 45m (load ~200): every package ok except
internal/gui, where TestMainWindowCorners and TestMainWindowRightToLeft
were killed at their deadline (#1936, #2645). Run alone: ok in 36s.
- gofmt -l clean.