mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-27 10:03:06 +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:
@@ -3,7 +3,6 @@ package channelserver
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"erupe-ce/common/mhfitem"
|
||||
cfg "erupe-ce/config"
|
||||
@@ -617,9 +616,6 @@ func TestPlateDataPersistenceDuringLogout(t *testing.T) {
|
||||
t.Log("Triggering logout via logoutPlayer")
|
||||
logoutPlayer(session)
|
||||
|
||||
// Give logout time to complete
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
// ===== VERIFICATION: Check all plate data was saved =====
|
||||
t.Log("--- Verifying plate data persisted ---")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user