Commit a55820b
authored
test: stabilize asynchronous cleanup waits (#26256)
## What type of PR is this?
- [x] BUG
- [x] Test and CI
## Which issue(s) this PR fixes:
Fixes #26254
Fixes #26255
## What this PR does / why we need it:
Two unrelated asynchronous subsystems were made flaky by test-only
timing assumptions under the parallel Ubuntu/x86 UT workload.
### Root cause
- TAE checkpoint tests wrapped real flush/checkpoint I/O in 5, 10, or 20
second deadlines. A single storage `writer.Sync` can legitimately exceed
20 seconds under parallel CI, so `TestSnapshotGC` could cancel
`ForceFlush` before the asynchronous work completed.
- The user-level-lock test service latched `blockUnlock=true` when
`Unlock` entered. Clearing the flag did not release calls already in
flight; all four detached-cleanup workers remained occupied until their
one-second contexts expired. A saturated 1,024-entry test queue could
therefore miss its three-second recovery assertion.
### Changes
- Add a shared one-minute checkpoint/flush timeout for storage-backed
TAE tests and apply it to the short checkpoint helpers and nearby direct
call sites.
- Make the user-level-lock test double observe recovery while an unlock
is in flight.
- Add a deterministic regression proving an already-blocked mock unlock
resumes promptly.
Production checkpoint and user-lock behavior is unchanged.
## Validation
-
`TestUserLevelLockCleanupTestServiceUnblocksInFlightUnlock|TestDetachedUserLevelLockCleanupQueueIsBoundedAndDeduped`:
`-race -count=20`
- `TestSnapshotGC|TestAppendAndGC2|TestCkpLeak|TestReplay2`: `-count=5`
- Same TAE set: `-race -count=1`
- Full `pkg/sql/plan/function`, `pkg/vm/engine/tae/db/test`, and
`pkg/vm/engine/tae/db/testutil` tests
- `go build` for affected production/test-support packages
- `go vet` for affected test packages1 parent 4c04a95 commit a55820b
4 files changed
Lines changed: 55 additions & 12 deletions
File tree
- pkg
- sql/plan/function
- vm/engine/tae/db
- testutil
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7441 | 7441 | | |
7442 | 7442 | | |
7443 | 7443 | | |
7444 | | - | |
| 7444 | + | |
| 7445 | + | |
7445 | 7446 | | |
7446 | 7447 | | |
7447 | 7448 | | |
| |||
7451 | 7452 | | |
7452 | 7453 | | |
7453 | 7454 | | |
| 7455 | + | |
7454 | 7456 | | |
7455 | 7457 | | |
7456 | 7458 | | |
7457 | 7459 | | |
7458 | | - | |
7459 | | - | |
| 7460 | + | |
| 7461 | + | |
| 7462 | + | |
| 7463 | + | |
| 7464 | + | |
| 7465 | + | |
| 7466 | + | |
| 7467 | + | |
| 7468 | + | |
| 7469 | + | |
| 7470 | + | |
| 7471 | + | |
7460 | 7472 | | |
7461 | 7473 | | |
7462 | 7474 | | |
| |||
7532 | 7544 | | |
7533 | 7545 | | |
7534 | 7546 | | |
| 7547 | + | |
| 7548 | + | |
| 7549 | + | |
| 7550 | + | |
| 7551 | + | |
| 7552 | + | |
| 7553 | + | |
| 7554 | + | |
| 7555 | + | |
| 7556 | + | |
| 7557 | + | |
| 7558 | + | |
| 7559 | + | |
| 7560 | + | |
| 7561 | + | |
| 7562 | + | |
| 7563 | + | |
| 7564 | + | |
| 7565 | + | |
| 7566 | + | |
| 7567 | + | |
| 7568 | + | |
| 7569 | + | |
| 7570 | + | |
| 7571 | + | |
| 7572 | + | |
| 7573 | + | |
| 7574 | + | |
| 7575 | + | |
7535 | 7576 | | |
7536 | 7577 | | |
7537 | 7578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7609 | 7609 | | |
7610 | 7610 | | |
7611 | 7611 | | |
7612 | | - | |
| 7612 | + | |
7613 | 7613 | | |
7614 | 7614 | | |
7615 | 7615 | | |
| |||
7836 | 7836 | | |
7837 | 7837 | | |
7838 | 7838 | | |
7839 | | - | |
| 7839 | + | |
7840 | 7840 | | |
7841 | 7841 | | |
7842 | 7842 | | |
| |||
8847 | 8847 | | |
8848 | 8848 | | |
8849 | 8849 | | |
8850 | | - | |
| 8850 | + | |
8851 | 8851 | | |
8852 | 8852 | | |
8853 | 8853 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
163 | | - | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
170 | | - | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
0 commit comments