mirror of https://github.com/jackc/pgx.git
Try to pacify finicky timing test on CI
parent
097b6aacb7
commit
49a860125f
|
@ -389,7 +389,14 @@ func TestPoolBackgroundChecksMaxConnIdleTime(t *testing.T) {
|
||||||
c, err := db.Acquire(context.Background())
|
c, err := db.Acquire(context.Background())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
c.Release()
|
c.Release()
|
||||||
time.Sleep(config.HealthCheckPeriod + 500*time.Millisecond)
|
time.Sleep(config.HealthCheckPeriod)
|
||||||
|
|
||||||
|
for i := 0; i < 1000; i++ {
|
||||||
|
if db.Stat().TotalConns() == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
time.Sleep(time.Millisecond)
|
||||||
|
}
|
||||||
|
|
||||||
stats := db.Stat()
|
stats := db.Stat()
|
||||||
assert.EqualValues(t, 0, stats.TotalConns())
|
assert.EqualValues(t, 0, stats.TotalConns())
|
||||||
|
|
Loading…
Reference in New Issue