mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-08 10:17:17 +00:00
## Problem The addon management e2e test "Template type addon should be configured by addon deployment config for proxy" fails intermittently with: "Stop creating csr since there are too many csr created already on hub" ## Root Cause Race condition between CSR deletion in AfterEach and API/cache consistency: 1. AfterEach deletes CSRs via API 2. Returns success immediately after Delete() calls succeed 3. Next test's BeforeEach starts before deletions fully propagate 4. CSR controller's indexer cache still shows deleted CSRs 5. haltAddonCSRCreation() checks cache, sees >=10 CSRs, halts creation ## Solution Modified AfterEach CSR cleanup to verify deletions complete: - After deleting CSRs, return error to force Eventually() to retry - Only return success when List() confirms 0 CSRs remain - Ensures API consistency before next test starts - Added logging to show CSR cleanup count for debugging This ensures the cache has time to sync and prevents accumulation of phantom CSRs across ordered test runs. Signed-off-by: Jian Zhu <jiazhu@redhat.com> Signed-off-by: zhujian <jiazhu@redhat.com>