zeroshade opened a new pull request, #1475: URL: https://github.com/apache/iceberg-go/pull/1475
## What `TestWaitForPlanBoundsSlowServerSideCancel` (added in #1469) is flaky. It failed on `main` in the `ubuntu-latest go1.25.8` cell of the `Go` workflow (run 29428513100 on commit 3648ea3) while passing on every other commit and matrix cell. ## Root cause `WaitForPlan` issues the server-side cancel (`DELETE .../plan/plan-1`) on a context **detached** from the caller (bounded by `CancelGracePeriod`). When the caller's context is cancelled, `WaitForPlan` returns `context.Canceled` immediately, while the detached goroutine issues the `DELETE` (which sets `cancelStarted`) concurrently. The test asserted `cancelStarted.Load()` **immediately** after `WaitForPlan` returned, so on a slower runner the assertion could execute before the detached cancel had been attempted. This is a race in the test, not in the product code. ## Fix Poll the flag with `assert.Eventually` (1s budget, 5ms tick) instead of reading it exactly once, and add a comment explaining why so it isn't "simplified" back. ## Verification - `go test ./catalog/rest/ -run TestWaitForPlan -race -count=50` → `ok` - full `catalog/rest` package (`-count=1`) → `ok` - `gofmt` / `go vet` clean -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
