Skip to content

fix(online/admin/console): keep a replaced session on a late 401 - #2718

Open
houko wants to merge 4 commits into
mainfrom
fix/flaky-online-assets-tests
Open

houko wants to merge 4 commits into
mainfrom
fix/flaky-online-assets-tests

Conversation

@houko

@houko houko commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Fixes the flaky tests this area had in the last two days of failed Test runs: TestSmokeViewerSeesNoActions (Windows), TestRunnerRecoversPanickingMatch (both panic tests), and TestWebTransportUnreliableNotBlockedByLostPacket (main). TestDLCResumesInterruptedDownloadViaRange and TestZshCompletion were stabilized on main by c42fbe3, PR #2621 merged the Windows editor file locks, and the rest of the list failed only on the branches that made them (see below).

Console: a late 401 signed the console out of a session opened since

app.run cleared a service's identity on any 401 that was not an answer to the sign-in call. When the console loads, start asks every service who is signed in; on a page without a session each answer is 401. If one of those was delivered after the operator signed in to that service, it cleared the new session's identity: the service's pages left the navigation while the session was still valid. TestSmokeViewerSeesNoActions failed this way on a Windows runner, with the leaderboard page's entry missing after signIn had seen it.

run now records the identity the call was sent with and clears the service's identity only while the console still holds that same one; a 401 to a call made for a session the console has replaced keeps the newer session. TestStaleUnauthorizedKeepsNewerSession holds the leaderboard's first whoami answer until the console has signed in, delivers it, and checks the page stays reachable.

Runner panic tests counted time instead of ticks

Both panic tests gave Runner.Run a 200 or 300 ms deadline and then required the sibling match to have ticked ten times. The Runner drops the ticks a busy machine delays instead of catching up, so a loaded runner never reached ten. The tests now count the sibling's ticks after OnPanic stopped the panicking match and end the run at the tenth; a 30 s deadline only bounds a sibling that stops ticking, which is the failure they look for.

The transport test's shaper took the lost packet's retransmission instead of its datagram

The shaper dropped the next UDP packet of at least 500 bytes. Packets are encrypted, so size was the only handle, and QUIC fills the room a datagram leaves with stream data it has to send — the lost reliable packet's retransmission included once its probe timeout had queued it. The datagram then left in a packet under 500 bytes, which the shaper held back with the retransmission, and the test waited out its deadline for a datagram only release could deliver. Both parts also shared one connection, so the second part could drop a late retransmission of the first part's reliable packet instead of its datagram.

armDrop(dropMin, dropMax, holdBelow) drops the first packet of a size range and holds back packets below a chosen size: the reliable packet and its retransmissions are 500 to 899 bytes, the datagram is padded past 900 bytes, and the second part drops 500 to 1280 bytes (quicInitialPacketSize, below every MTU probe) on a connection of its own.

The other listed failures

Verification

  • go run ./pkg/online/admin/console/internal/consolebuild -check: CHECK-OK; the embedded build in dist is regenerated and dist.inputs records the new inputs.
  • go tool nsgo test ./pkg/online/admin/console/... ./pkg/online/netplay ./pkg/online/gameserver ./pkg/assets: 497 passed, 0 failed.
  • The panic and transport tests at -count=50 -race with -cpu=1, 2 and 8: 150 passed each; the console tests at -count=10 -race: 20 passed.
  • go tool nsgo check -target macos .: vetted for macos_arm64 and macos_x64; GOOS=windows go vet over the three touched packages: clean.
  • Without the console fix TestStaleUnauthorizedKeepsNewerSession fails; without the shaper fix the transport test times out.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area/agents pkg/online size/M bug Something isn't working labels Dec 1, 2026
@houko
houko force-pushed the fix/flaky-online-assets-tests branch from 2a2b57d to aabbc59 Compare December 1, 2026 03:02
@houko

houko commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Verify release build tag strips debug code failed on aabbc59 (job 142363635689) for a reason unrelated to this PR: GitHub answered the AppImage runtime download (AppImage/type2-runtime 20251108 runtime-x86_64) with HTTP 618 while nsgo build packaged the linux_x64 release. Examples Required CI only reports that failure. The failed jobs have been rerun once. The download gets a CI-side cache in #2720, and NSGo's missing retry is tracked in nsgo-dev/nsgo#2815.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agents bug Something isn't working documentation Improvements or additions to documentation pkg/online size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant