diff --git a/pgxpool/common_test.go b/pgxpool/common_test.go index 04f370c6..c701e1f7 100644 --- a/pgxpool/common_test.go +++ b/pgxpool/common_test.go @@ -17,7 +17,7 @@ import ( // completed. To test something that relies on the actual work for Conn.Release being completed we must simply wait. // This function wraps the sleep so there is more meaning for the callers. func waitForReleaseToComplete() { - time.Sleep(25 * time.Millisecond) + time.Sleep(500 * time.Millisecond) } type execer interface { diff --git a/pgxpool/pool_test.go b/pgxpool/pool_test.go index 6b7afa49..54b688a1 100644 --- a/pgxpool/pool_test.go +++ b/pgxpool/pool_test.go @@ -366,7 +366,7 @@ func TestPoolBackgroundChecksMaxConnLifetime(t *testing.T) { c, err := db.Acquire(context.Background()) require.NoError(t, err) c.Release() - time.Sleep(config.MaxConnLifetime + 100*time.Millisecond) + time.Sleep(config.MaxConnLifetime + 500*time.Millisecond) stats := db.Stat() assert.EqualValues(t, 0, stats.TotalConns()) @@ -389,7 +389,7 @@ func TestPoolBackgroundChecksMaxConnIdleTime(t *testing.T) { c, err := db.Acquire(context.Background()) require.NoError(t, err) c.Release() - time.Sleep(config.HealthCheckPeriod + 100*time.Millisecond) + time.Sleep(config.HealthCheckPeriod + 500*time.Millisecond) stats := db.Stat() assert.EqualValues(t, 0, stats.TotalConns()) @@ -406,7 +406,7 @@ func TestPoolBackgroundChecksMinConns(t *testing.T) { require.NoError(t, err) defer db.Close() - time.Sleep(config.HealthCheckPeriod + 100*time.Millisecond) + time.Sleep(config.HealthCheckPeriod + 500*time.Millisecond) stats := db.Stat() assert.EqualValues(t, 2, stats.TotalConns())