Skip to content

Commit 57b5c83

Browse files
committed
test(e2e): widen the clock margin of the own-bound cutoff test
The test that a call cut by its own bound just past the deadline is not blamed on the budget ran a 3s bound inside a 4s pod section. A whole-second tick of date +%s between DP_T0 and the first call left the bound reaching the deadline, the collector then blamed the budget, as it should, and the test failed. The pod section is now 10s against the same 3s bound, so a tick cannot reach the deadline. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 0c9806a commit 57b5c83

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎hack/capture-dataplane.bats‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,23 +2917,25 @@ STUB
29172917
@test "a call cut by its own bound just past the deadline is not blamed on the budget" {
29182918
# Whether the budget cut a call is decided by the bound it ran under: only a
29192919
# bound that reached the deadline can be the deadline's. Here the pod list
2920-
# runs under its own 3s bound, well inside the pod section's 4s, and comes
2921-
# back from its kill grace after the deadline has passed; the clock after the
2922-
# call would blame the budget for what its own bound did.
2920+
# runs under its own 3s bound inside the pod section's 10s and comes back
2921+
# from its kill grace after the deadline has passed; the clock after the call
2922+
# would blame the budget for what its own bound did. The 7s between the bound
2923+
# and the deadline keep a whole-second tick of `date +%s` between DP_T0 and
2924+
# the call from turning the bound into the deadline's.
29232925
d=$(mktemp -d)
29242926
mkdir -p "$d/bin"
29252927
printf '#!/bin/sh\nexit 0\n' >"$d/bin/kubectl"
29262928
real_timeout=$(command -v timeout)
29272929
cat >"$d/bin/timeout" <<SHIM
29282930
#!/bin/sh
29292931
case "\$*" in
2930-
*'kubectl get pods -A '*) sleep 5; exit 137 ;;
2932+
*'kubectl get pods -A '*) sleep 12; exit 137 ;;
29312933
esac
29322934
exec "$real_timeout" "\$@"
29332935
SHIM
29342936
chmod +x "$d/bin/kubectl" "$d/bin/timeout"
29352937
rc=0
2936-
PATH="$d/bin:$PATH" COZY_DATAPLANE_LIST_TIMEOUT=3 COZY_DATAPLANE_BUDGET=94 COZY_DATAPLANE_LB_RESERVE=90 \
2938+
PATH="$d/bin:$PATH" COZY_DATAPLANE_LIST_TIMEOUT=3 COZY_DATAPLANE_BUDGET=100 COZY_DATAPLANE_LB_RESERVE=90 \
29372939
"$real_timeout" 60 "$SCRIPT" "$d/out" >"$d/log" 2>&1 || rc=$?
29382940
[ "$rc" -eq 0 ] || { echo "the collector did not finish on its own (exit $rc):"; cat "$d/log"; exit 1; }
29392941
notes="$d/out/capture-notes.txt"

0 commit comments

Comments
 (0)