test(kube): tolerate IsNotFound on namespace cleanup#860
Conversation
AfterTest lists namespaces by label, then deletes each. A namespace from a previous test could still be in Terminating state when listed, then finish terminating before the Delete lands, returning NotFound. This caused the flaky failure in TestGetPodsDataWithThrottling on PR #858 (grpc 1.80→1.81 dependabot bump shifted timing enough to expose it). Skip NotFound errors on cleanup deletes — the namespace is gone, which is what we wanted.
|
Claude finished @mbevc1's task in 1m 30s —— View job PR Review: test(kube): tolerate IsNotFound on namespace cleanup
Static analysis: All clear — Review: This is a clean, correct fix for a real race condition in test cleanup. The problem is well-described: The change is minimal (4 lines), correctly scoped to test infrastructure only, and doesn't affect production code. The LGTM 👍 |
AfterTestlists namespaces by label, then deletes each. A namespace from a previous test could still be inTerminatingstate when listed, then finish terminating before theDeletelands, returningNotFound. This caused the flaky failure inTestGetPodsDataWithThrottlingon PR #858 (it shifted timing enough to expose it).Skip
NotFounderrors on cleanup deletes — the namespace is gone, which is the intent.