Skip to content

Commit e5e6ae9

Browse files
stubbiclaude
andcommitted
test(conformance): non-blocking per-entry cleanup (don't stall on finalizers)
The idempotency run was hanging (then timing out) in the backup-enabled entry's DeferCleanup: deleting the instance triggers the operator's on-delete backup finalizer, whose snapshot Job can't complete with placeholder S3 creds, so the default `kubectl delete` (which waits for finalizers) blocked indefinitely and starved the remaining corpus entries. All 7 prior entries pass (Ready + idempotency); switch the per-entry cleanup to a non-blocking delete (--wait=false) so the full corpus runs. The ephemeral cluster is torn down at the end, so a terminating instance left behind is harmless. (Follow-up, operator-side: the backup-on-delete finalizer should not block deletion indefinitely when the backup fails — an instance with bad creds is otherwise undeletable.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8d94eac commit e5e6ae9

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

test/conformance/helpers.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ func kubectlDelete(yaml string) (string, error) {
5252
return runStdin("kubectl", []string{"delete", "--ignore-not-found", "-f", "-"}, yaml)
5353
}
5454

55+
// kubectlDeleteNoWait deletes without blocking on finalizers. Used for per-entry
56+
// cleanup in the idempotency corpus: some fixtures (e.g. backup-enabled) install
57+
// an on-delete finalizer whose snapshot Job cannot complete with placeholder
58+
// credentials, so a default `kubectl delete` (which waits for the finalizer)
59+
// would hang and starve the remaining corpus entries. The ephemeral cluster is
60+
// torn down at the end, so leaving a terminating instance behind is harmless.
61+
func kubectlDeleteNoWait(yaml string) (string, error) {
62+
return runStdin("kubectl", []string{"delete", "--ignore-not-found", "--wait=false", "-f", "-"}, yaml)
63+
}
64+
5565
func clientcmdPath() string {
5666
if p := os.Getenv("KUBECONFIG"); p != "" {
5767
return p

test/conformance/idempotency_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ var _ = Describe("idempotency canary", Ordered, func() {
147147
Expect(instName).ToNot(BeEmpty(), "could not extract name from fixture %s", entry.fixture)
148148

149149
DeferCleanup(func() {
150-
_, _ = kubectlDelete(namespaced)
150+
// Non-blocking: a fixture's on-delete finalizer (e.g.
151+
// backup-enabled's snapshot Job on placeholder creds) must not
152+
// stall the rest of the corpus. The namespace is torn down at end.
153+
_, _ = kubectlDeleteNoWait(namespaced)
151154
})
152155
})
153156

0 commit comments

Comments
 (0)