AlinsRan opened a new pull request, #2789:
URL: https://github.com/apache/apisix-ingress-controller/pull/2789
## Description
This is the pilot of the "P1" e2e flakiness/runtime effort: converting fixed
`time.Sleep` delays in test spec bodies to polling assertions. It changes a
single file (`test/e2e/crds/v2/globalrule.go`) so the pattern can be validated
in CI before being rolled out to the remaining spec files.
Fixed sleeps are the primary source of e2e flakiness (too short → sporadic
failures; too long → wasted wall-clock). Polling assertions both speed up the
happy path and remove the race against controller reconciliation.
## Conversion patterns established
| Original | Converted to |
|---|---|
| create resource, then `time.Sleep` (followed later by a polling assertion)
| removed — the trailing assertion already polls the whole chain |
| `time.Sleep` + `GetResourceYaml` + status substring asserts |
`s.RetryAssertion(getYaml).Should(And(ContainSubstring...))` (via a small
`globalRuleAccepted` helper) |
| `time.Sleep` + single request + header/body asserts |
`s.RequestAssert{Checks: [...]}` using `WithExpectedHeader` /
`WithExpectedNotHeader` / `WithExpectedBodyContains/NotContains`, which retry
until APISIX reflects the change |
All 13 fixed sleeps in this file are removed. Changes are confined to the
spec body (no scaffold/framework changes), so they are provider-agnostic.
## Follow-ups (not in this PR)
The same patterns will be applied to the remaining ~27 e2e spec files (~175
sleeps), with the heaviest in `webhook/ssl_conflict.go`, `ingress/ingress.go`,
and `webhook/helpers.go`. Rolling those out in separate PRs once this pattern
is confirmed green in CI.
--
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]