database/sql: TestTxContextWaitNoDiscard failure due to race between timeouts #53222
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Testing
An issue that has been verified to require only test changes, not just a test failure.
Milestone
greplogs -l -e 'FAIL: TestTxContextWaitNoDiscard'
2022-06-03T00:13:09-7846e25/freebsd-arm-paulzhol
This test employs two arbitrary timeouts: the transaction times out after 15 ms, and the query completes after 1 s.
However,
Context
timeouts are asynchronous and propagate on best-effort. If the timeout propagation happens to be delayed by one second (as can easily happen on a slow and/or overloaded builder), then the query can unexpectedly complete.Probably the best solution is to change the query to wait for an unbounded time instead of just one second.
(attn @bradfitz @kardianos; CC @kevinburke per https://dev.golang.org/owners)
The text was updated successfully, but these errors were encountered: