test(channelserver): replace time.Sleep with polling loops

Blind sleeps accumulate serially (no t.Parallel anywhere) and inflate
under the race detector's scheduling overhead — contributing to the
~136s channelserver test run time.

Replace ~75 arbitrary sleeps (50ms–1s) across 7 test files with 2s
polling loops that exit as soon as the expected condition holds. Sleeps
that are genuinely intentional (race-condition stress tests, cache
expiry, temporal spacing in timestamp tests, backpressure pacing) are
left untouched.
This commit is contained in:
Houmgaor
2026-03-23 10:57:01 +01:00
parent 0c6dc39371
commit d0efc4e81a
8 changed files with 159 additions and 75 deletions

View File

@@ -229,7 +229,6 @@ func TestRengokuData_SaveLoadRoundTrip_AcrossSessions(t *testing.T) {
// Logout session 1
logoutPlayer(session1)
time.Sleep(100 * time.Millisecond)
// === SESSION 2: Load data in new session ===
session2 := createTestSessionForServerWithChar(server, charID, "RengokuChar2")
@@ -348,7 +347,6 @@ func TestRengokuData_SkillRegionPreserved(t *testing.T) {
handleMsgMhfSaveRengokuData(session1, savePkt)
drainAck(t, session1)
logoutPlayer(session1)
time.Sleep(100 * time.Millisecond)
// === SESSION 2: Load and verify skill region ===
session2 := createTestSessionForServerWithChar(server, charID, "SkillChar")