From fead5971308afb9d035ae2f031d5fbd0d9e2b3b3 Mon Sep 17 00:00:00 2001 From: Derek Menteer Date: Tue, 16 Jan 2024 08:16:49 -0600 Subject: [PATCH] Increase timeouts for flakey peering test. --- agent/grpc-external/services/peerstream/stream_test.go | 4 ++-- agent/grpc-external/services/peerstream/testing.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/grpc-external/services/peerstream/stream_test.go b/agent/grpc-external/services/peerstream/stream_test.go index d5a0abd6b4..37e5e99a76 100644 --- a/agent/grpc-external/services/peerstream/stream_test.go +++ b/agent/grpc-external/services/peerstream/stream_test.go @@ -1175,7 +1175,7 @@ func TestStreamResources_Server_CARootUpdates(t *testing.T) { func TestStreamResources_Server_AckNackNonce(t *testing.T) { srv, store := newTestServer(t, func(c *Config) { - c.incomingHeartbeatTimeout = 10 * time.Millisecond + c.incomingHeartbeatTimeout = 5 * time.Second }) p := writePeeringToBeDialed(t, store, 1, "my-peer") @@ -1222,7 +1222,7 @@ func TestStreamResources_Server_AckNackNonce(t *testing.T) { }) // Add in a sleep to prevent the test from flaking. // The mock client expects certain calls to be made. - time.Sleep(50 * time.Millisecond) + time.Sleep(500 * time.Millisecond) } // Test that when the client doesn't send a heartbeat in time, the stream is disconnected. diff --git a/agent/grpc-external/services/peerstream/testing.go b/agent/grpc-external/services/peerstream/testing.go index 47cc8d1dbe..b5e79a6347 100644 --- a/agent/grpc-external/services/peerstream/testing.go +++ b/agent/grpc-external/services/peerstream/testing.go @@ -30,7 +30,7 @@ func (c *MockClient) Send(r *pbpeerstream.ReplicationMessage) error { } func (c *MockClient) Recv() (*pbpeerstream.ReplicationMessage, error) { - return c.RecvWithTimeout(10 * time.Millisecond) + return c.RecvWithTimeout(100 * time.Millisecond) } func (c *MockClient) RecvWithTimeout(dur time.Duration) (*pbpeerstream.ReplicationMessage, error) {