Repository navigation
test(e2e): isolate pending-delete outage test from the mecak8s reconciler - #2177
Merged
Merged
Conversation
…iler TestKindExecutionProductionPendingDeleteOutageRecovery held a synthetic PendingDelete intent open across a provider restart using the mecak8s client identity. The deployed mecak8s agent shares that identity and its reference-intent reconciler confirms any of its client's pending deletes whose binding has no durable session, so whenever its one-minute tick landed in the restart window the intent vanished and the test failed with listed=0 exact_code=not_found. Issue a dedicated qualification client identity in the PKI fixture (and keep the rotation manifests' client list in step) and run this test as that client. Intents are client-scoped, so the agent can no longer see the synthetic intent. Co-authored-by: Mecatl <[email protected]>
Merged
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a flaky failure in the production k8s execution qualification job:
Recent runs that failed this way include three on
main(37657699332, 37621455637, 37540496088) and several on unrelated branches.Root cause
This is a race in how the test is isolated, not a provider durability bug.
PrepareReferenceDelete, restarts the provider, and expects thePendingDeleteintent to still exist. It connected as themecak8smTLS client.ReconcileReferenceIntentsat startup and then every minute (internal/app/reference_intent_reconcile.go).internal/adapter/server/service.go,ReconcileReferenceIntents). The test's binding is synthetic, so it never has a session.listed=0andnot_found.Other tests that use the
mecak8sidentity are unaffected.retireSyntheticEnvironmentconfirms the delete straight away, and a second confirm on a reference that's already gone returns nil. The reconciler always leaves pending creates alone.Fix
The provider only shows each client the intents it created (via
spec.clientHash). So:fixture/pki: issue a dedicatedspiffe://mecatl.test/client/qualificationclient identity and allow it in the security manifest. It has the same rights asmecak8s(can attest owners, administrator), since it needs administrator to retire and delete its own environment.fixture/rotation: add the same client entry, so every manifest version has the same client list.productionClientAs(..., identity), withproductionClientnow calling it formecak8s, and runTestKindExecutionProductionPendingDeleteOutageRecoveryasqualification. The privacy check against theintruderclient still applies.Testing
go vet -tags kind_execution_e2e ./e2e/k8s_execution/...qualification.crthas the expected SPIFFE URI and the client appears in the rotation manifests. The new manifest entry passes the provider's client-policy checks.task lint,task test:race, and themecademosmoke test pass.execution provider production profile (kind)job is the verification.Note for local kind runs:
deploy/mecatl-execution-kind/run.shskips certificate generation when$state/pki/ca.crtalready exists. Delete$state/pkifrom a reused state directory soqualification.crtgets generated.