Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: de-flake TestRefreshPendingCommands
The test ran a for loop without preemption points. The loop checked a condition that would only become true after another goroutine had been scheduled and carried out its job. If, with only few cores (four in my case) GC kicked in before that other goroutine got scheduled, that loop would just run hot forever until the test timed out, and the resulting stack dump looked quite unhelpful. Add a small sleep so the runtime can preempt the goroutine. The issue was harder to run into when stressing only the test, since there was less garbage available at that point. Adding some print statements, I accidentally made it much more likely. Previously flaked (got stuck) within <500iters, now ran past 1.5k without problems. Fixes cockroachdb#19397. Fixes cockroachdb#19388. Touches cockroachdb#19367. Fixes cockroachdb#18554.
- Loading branch information