Skip to content

Commit 6c76a46

Browse files
test(e2e): fold remaining post-branch bats drift into the Chainsaw suites
- qdrant: add the post-delete PVC-reclaim guard (#3059) — delete the CR and poll the ordinal-anchored data PVC to absence via the error op (retries transient API errors internally), with a PVC/jobs/pods dump on failure; Chainsaw auto-cleanup alone would never notice a leaked StatefulSet-templated PVC - kuberture: make the split-horizon negative log assertions fail loud — under set -e a pipeline beginning with ! suppresses errexit, so both leak checks silently passed (the same vacuous-negation bug main fixed in 12fe325) - foundationdb: retry the one-shot generations.reconciled read for up to 2m — the operator stamps it after the post-bounce uptime gate, so it can trail the fdbcli-derived health fields the previous assert converged on (a79f800) - kubernetes-latest: add the version-independent SC-fallback-default Test (#2872 B1) calling verify_storageclass_fallback_default from the shared lib; a separate Test doc so it runs regardless of the heavy bringup Test's outcome, safe under the suite-wide parallel: 1 while it temporarily mutates cluster-scoped StorageClasses Assisted-By: Claude <[email protected]> Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent d6ac62a commit 6c76a46

4 files changed

Lines changed: 78 additions & 3 deletions

File tree

‎hack/e2e-chainsaw/foundationdb/chainsaw-test.yaml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,15 @@ spec:
117117
sleep 5
118118
done
119119
fdb '{.status.desiredProcessGroups}' | grep -qE '^[0-9]+$'
120-
fdb '{.status.generations.reconciled}' | grep -qE '^[0-9]+$'
120+
# generations.reconciled is stamped by the operator after the
121+
# post-bounce uptime gate and can trail the fdbcli-derived health
122+
# fields the previous assert converged on; retry briefly instead of
123+
# a one-shot read (mirrors main's widened budgets, a79f8009f).
124+
deadline=$(( $(date +%s) + 120 ))
125+
until fdb '{.status.generations.reconciled}' | grep -qE '^[0-9]+$'; do
126+
[ "$(date +%s)" -ge "$deadline" ] && { echo "generations.reconciled not stamped" >&2; fdb '{.status.generations}' >&2; exit 1; }
127+
sleep 5
128+
done
121129
check:
122130
($error == null): true
123131

‎hack/e2e-chainsaw/kubernetes-latest/chainsaw-test.yaml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,35 @@ spec:
4848
cd ../../..
4949
. hack/e2e-chainsaw/_lib/run-kubernetes.sh
5050
cozy_cleanup
51+
---
52+
# Version-independent regression guard for PR #2872 B1 (runs once, here, not
53+
# in kubernetes-previous): with the `replicated` StorageClass absent on the
54+
# management cluster, the chart's fallback default must be a real management
55+
# SC (nvme/ssd probes) and never the `kubevirt` alias. A separate Test doc,
56+
# not a step of the bringup Test above, because it provisions no tenant
57+
# cluster and must run regardless of that heavy test's outcome (Chainsaw
58+
# skips a Test's remaining steps after a failure).
59+
#
60+
# The helper temporarily deletes the cluster-scoped `replicated` SC and
61+
# restores it inline before any assertion exit; safe only because the global
62+
# .chainsaw.yaml runs suites sequentially (execution.parallel: 1) — nothing
63+
# else can schedule against the mutated SC set mid-probe.
64+
apiVersion: chainsaw.kyverno.io/v1alpha1
65+
kind: Test
66+
metadata:
67+
name: kubernetes-sc-fallback-default
68+
spec:
69+
catch:
70+
- events: {}
71+
steps:
72+
- name: fallback-default-storageclass
73+
try:
74+
- script:
75+
timeout: 15m
76+
content: |
77+
set -eu
78+
cd ../../..
79+
. hack/e2e-chainsaw/_lib/run-kubernetes.sh
80+
verify_storageclass_fallback_default
81+
check:
82+
($error == null): true

‎hack/e2e-chainsaw/kuberture/chainsaw-test.yaml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,17 @@ spec:
161161
# The default-prefix probe sees only the public hostname; the internal-
162162
# prefix probe sees only the internal hostname.
163163
echo "$pub_logs" | grep -Fq "$pub_host"
164-
! echo "$pub_logs" | grep -Fq "$int_host"
164+
# Fail-loud negations: under `set -e` a pipeline beginning with `!`
165+
# suppresses errexit, so `! ... | grep` silently passes when the
166+
# leak occurs (the vacuous-negation bug 12fe3256f fixed in bats).
167+
if echo "$pub_logs" | grep -Fq "$int_host"; then
168+
echo "FAIL: public-prefix probe must NOT see the internal hostname $int_host" >&2
169+
exit 1
170+
fi
165171
echo "$int_logs" | grep -Fq "$int_host"
166-
! echo "$int_logs" | grep -Fq "$pub_host"
172+
if echo "$int_logs" | grep -Fq "$pub_host"; then
173+
echo "FAIL: internal-prefix probe must NOT see the public hostname $pub_host" >&2
174+
exit 1
175+
fi
167176
check:
168177
($error == null): true

‎hack/e2e-chainsaw/qdrant/chainsaw-test.yaml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,29 @@ spec:
6262
name: qdrant-storage-qdrant-test-0
6363
status:
6464
phase: Bound
65+
66+
- name: verify-pvc-reclaim-on-delete
67+
try:
68+
# Issue #3059: Kubernetes never GCs StatefulSet-templated PVCs; the
69+
# chart's post-delete cleanup hook Job must reclaim the data PVC
70+
# asynchronously during uninstall (ordinal-anchored so a sibling's PVC is
71+
# never deleted, 2587458bd/ae7c23240). The `error` op polls for absence
72+
# and retries transient API errors internally, so a blip is never misread
73+
# as "reclaimed" (2m mirrors the bats ~120s budget).
74+
- delete:
75+
ref:
76+
apiVersion: apps.cozystack.io/v1alpha1
77+
kind: Qdrant
78+
name: test
79+
- error:
80+
timeout: 2m
81+
resource:
82+
apiVersion: v1
83+
kind: PersistentVolumeClaim
84+
metadata:
85+
name: qdrant-storage-qdrant-test-0
86+
catch:
87+
- script:
88+
content: |
89+
kubectl -n "$NAMESPACE" get pvc -o wide
90+
kubectl -n "$NAMESPACE" get jobs,pods -l app.kubernetes.io/instance=qdrant-test -o wide

0 commit comments

Comments
 (0)