Skip to content

test: Assert TPP Programmed tracks generation bumps - #336

Open
mattdjenkinson wants to merge 4 commits into
mainfrom
test/266-programmed-generation
Open

test: Assert TPP Programmed tracks generation bumps#336
mattdjenkinson wants to merge 4 commits into
mainfrom
test/266-programmed-generation

Conversation

@mattdjenkinson

Copy link
Copy Markdown
Contributor

Summary

NSO#266’s regression gap was that a TPP spec change could lag on the edge with no test asserting the lag is observable. Create-path already checks Programmed=True; this adds a generation-bump scenario: after a real edit, Programmed must lag (False or observedGeneration < generation) so skew is queryable, then catch up to the new generation — an unbounded silent tail fails.

Wire-level inverted-paranoia remediation stays in trafficprotectionpolicy-neutralize-inverted; this test owns the Programmed/generation contract from ecv’s acceptance checklist on #266.

Test plan

Related to #266

Add a Chainsaw e2e for NSO#266: after a TrafficProtectionPolicy spec
change, skew must be queryable via Programmed lag, then Programmed must
catch up to the new generation. Silent unbounded lag fails the test.
ecv
ecv previously approved these changes Aug 5, 2026
Chainsaw invokes scripts with /usr/bin/sh (dash on Ubuntu). Bash
here-strings caused an immediate Syntax error: redirection unexpected
and failed the new programmed-generation test in CI.

Key features:
- replace <<< / seq with set -- and while loops
- keep skew-then-converge assertions unchanged
@mattdjenkinson

Copy link
Copy Markdown
Contributor Author

CI failure was sh: Syntax error: redirection unexpected — the skew/converge step used bash <<< while Chainsaw runs /usr/bin/sh (dash). Pushed a POSIX rewrite in 91f7c98.

Chainsaw scripts do not inherit the test namespace as kubectl's
default. Getting gen-waf without -n hit default and failed under
set -u with "parameter not set" before the skew probes ran.

Key features:
- pass -n "$NAMESPACE" on get/patch/catch dumps
@mattdjenkinson

Copy link
Copy Markdown
Contributor Author

Next failure was namespace scoping: kubectl get … gen-waf hit default (NotFound), then set -u died on empty $1. Scoped the script to -n "$NAMESPACE" in the follow-up commit.

Single-cluster e2e converges Programmed before the first poll, so
requiring an intermediate obs<gen window fails every run. Assert that
Programmed tracks the post-edit generation instead; lag under real
multi-edge delay is covered by the apply-lag SLO alert.

Key features:
- wait for generation bump + Programmed observedGeneration catch-up
- fix catch logs to the e2e extension-server Deployment
@mattdjenkinson

Copy link
Copy Markdown
Contributor Author

Root cause of the latest failure: in single-cluster e2e, Programmed was already True/observedGeneration=2 on the first poll after the patch, so the mandatory skew window never appeared.

Dropped the flaky intermediate-skew assert (forcing it would mean scaling the shared extension server and breaking parallel tests). The test now gates the real contract: after a gen bump, Programmed must report observedGeneration for the new generation. Multi-edge lag visibility stays with TrafficProtectionPolicyApplyLagSLOViolation.

@mattdjenkinson
mattdjenkinson requested a review from ecv August 6, 2026 09:13
@mattdjenkinson mattdjenkinson self-assigned this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants