Increase timeouts for flakey peering test.

pull/20212/head
Derek Menteer 2024-01-16 08:16:49 -06:00
parent dcba25f118
commit fead597130
2 changed files with 3 additions and 3 deletions

View File

@ -1175,7 +1175,7 @@ func TestStreamResources_Server_CARootUpdates(t *testing.T) {
func TestStreamResources_Server_AckNackNonce(t *testing.T) { func TestStreamResources_Server_AckNackNonce(t *testing.T) {
srv, store := newTestServer(t, func(c *Config) { srv, store := newTestServer(t, func(c *Config) {
c.incomingHeartbeatTimeout = 10 * time.Millisecond c.incomingHeartbeatTimeout = 5 * time.Second
}) })
p := writePeeringToBeDialed(t, store, 1, "my-peer") 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. // Add in a sleep to prevent the test from flaking.
// The mock client expects certain calls to be made. // 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. // Test that when the client doesn't send a heartbeat in time, the stream is disconnected.

View File

@ -30,7 +30,7 @@ func (c *MockClient) Send(r *pbpeerstream.ReplicationMessage) error {
} }
func (c *MockClient) Recv() (*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) { func (c *MockClient) RecvWithTimeout(dur time.Duration) (*pbpeerstream.ReplicationMessage, error) {