We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 097b6aa commit 49a8601Copy full SHA for 49a8601
1 file changed
pgxpool/pool_test.go
@@ -389,7 +389,14 @@ func TestPoolBackgroundChecksMaxConnIdleTime(t *testing.T) {
389
c, err := db.Acquire(context.Background())
390
require.NoError(t, err)
391
c.Release()
392
- time.Sleep(config.HealthCheckPeriod + 500*time.Millisecond)
+ time.Sleep(config.HealthCheckPeriod)
393
+
394
+ for i := 0; i < 1000; i++ {
395
+ if db.Stat().TotalConns() == 0 {
396
+ break
397
+ }
398
+ time.Sleep(time.Millisecond)
399
400
401
stats := db.Stat()
402
assert.EqualValues(t, 0, stats.TotalConns())
0 commit comments