mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-28 18:42:39 +01:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user