mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-07-10 00:14:38 +00:00
Bump WebSocket read deadlines from 2s to 15s in router integration tests
The four ReadDeadline(time.Now().Add(2 * time.Second)) calls in router_integration_test.go (lines 1496, 1543, 1573, 1682) were producing 'read tcp: i/o timeout' failures in CI under -race while passing locally. The 2-second window is enough to read the welcome + initialState messages on a quiet dev workstation but too tight once the runner is loaded with cumulative test work and the race detector overhead. rc.5 cleared the same tests in CI but recent fixture-size growth (k8s clusters 1->3 in7938f28deplus the SMART disk-temperature mock data added in23ea4e487) pushed the end-to-end server-start-to-welcome-message latency past the 2s budget. Bumping to 15s gives CI breathing room without affecting local test duration (the deadline only takes effect when the read is genuinely stuck).
This commit is contained in:
parent
89a1740241
commit
7cb5f74db8
1 changed files with 4 additions and 4 deletions
|
|
@ -1493,7 +1493,7 @@ func TestWebSocketSendsInitialState(t *testing.T) {
|
|||
|
||||
readMsg := func() (string, map[string]any) {
|
||||
t.Helper()
|
||||
if err := conn.SetReadDeadline(time.Now().Add(2 * time.Second)); err != nil {
|
||||
if err := conn.SetReadDeadline(time.Now().Add(15 * time.Second)); err != nil {
|
||||
t.Fatalf("set deadline: %v", err)
|
||||
}
|
||||
_, data, err := conn.ReadMessage()
|
||||
|
|
@ -1540,7 +1540,7 @@ func TestWebSocketSendsInitialState(t *testing.T) {
|
|||
state := srv.monitor.BuildFrontendState()
|
||||
srv.hub.BroadcastState(state)
|
||||
|
||||
deadline := time.Now().Add(2 * time.Second)
|
||||
deadline := time.Now().Add(15 * time.Second)
|
||||
for {
|
||||
msgType, payload = readMsg()
|
||||
if msgType == "rawData" {
|
||||
|
|
@ -1570,7 +1570,7 @@ func TestWebsocketPayloadContractShape(t *testing.T) {
|
|||
|
||||
readMsg := func() (string, map[string]any) {
|
||||
t.Helper()
|
||||
if err := conn.SetReadDeadline(time.Now().Add(2 * time.Second)); err != nil {
|
||||
if err := conn.SetReadDeadline(time.Now().Add(15 * time.Second)); err != nil {
|
||||
t.Fatalf("set deadline: %v", err)
|
||||
}
|
||||
_, data, err := conn.ReadMessage()
|
||||
|
|
@ -1679,7 +1679,7 @@ func TestWebsocketPayloadUsesCanonicalStateContract(t *testing.T) {
|
|||
|
||||
readMsg := func() (string, map[string]any) {
|
||||
t.Helper()
|
||||
if err := conn.SetReadDeadline(time.Now().Add(2 * time.Second)); err != nil {
|
||||
if err := conn.SetReadDeadline(time.Now().Add(15 * time.Second)); err != nil {
|
||||
t.Fatalf("set deadline: %v", err)
|
||||
}
|
||||
_, data, err := conn.ReadMessage()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue