mirror of https://github.com/jackc/pgx.git
Improve flickering test on CI
parent
93a579754b
commit
ec9bb2ace7
|
@ -3632,6 +3632,7 @@ func TestCancelRequestContextWatcherHandler(t *testing.T) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 4*time.Millisecond)
|
ctx, cancel := context.WithTimeout(context.Background(), 4*time.Millisecond)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
pgConn.Exec(ctx, "select 1, pg_sleep(0.010)").ReadAll()
|
pgConn.Exec(ctx, "select 1, pg_sleep(0.010)").ReadAll()
|
||||||
|
time.Sleep(100 * time.Millisecond) // ensure a cancel request that was a little late doesn't interrupt ensureConnValid.
|
||||||
ensureConnValid(t, pgConn)
|
ensureConnValid(t, pgConn)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue