Skip to content

test: cover OTel replay and user function contexts - #960

Open
zhongkechen wants to merge 31 commits into
mainfrom
test/otel-user-context-conformance
Open

zhongkechen wants to merge 31 commits into
mainfrom
test/otel-user-context-conformance

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Add public SDK handlers for OTel cases 21–24: completed-operation replay, active context in user functions/callbacks, and invocation retry status. Ordinary user spans inherit their active parent; handlers do not attach replacement context or invoke plugin hooks. Both views execute the same workflow code.

Pin shared requirements aws/aws-durable-execution-conformance-tests#131 to 6182cee00ed33ce01e0579066fb31096f988817f. Case 24 checks exactly RETRYING then SUCCEEDED, optionally with one canonical PENDING suspension for the public step retry delay between them. Counts, first flags, span status, ordering, full Invocation coverage and a five-second stability window reject incorrect or extra phases; expected operation redelivery after invocation failure remains allowed. Cases cover handler entry/restoration/resume, steps, child contexts, parallel/map branches, polling predicates, callback submitters, retry helpers and virtual contexts. The shared coverage matrix documents initialization, policy, serialization and application-created thread boundaries that lack an active SDK-operation-span contract.

Runtime prerequisites included here are replay #953, local invocation wrapper #954, clock #962 and polling continuation links #964; CI repair #959 is also included. Merge those and the shared requirements first, with #954 before #953, then update this branch from main to remove their shared diffs. No plugin API or factory-lifetime migration is introduced.

The replay fix exports externally completed operations even when workflow code defers reading the result until after another suspension. Both views collect current-invocation updates, export fresh pending completions during traversal even when the SDK marks them replay, and drain remaining unobserved completions before cleanup. This retains an active child parent and deduplicates within the invocation. Failed-invocation redelivery remains eligible. Error events preserve logical completion timestamps. The clock fix uses coherent logical millisecond boundaries, includes observed descendant starts in active containing contexts, and keeps execution-view invocation ends at or beyond SDK timestamps they actually observed.

Validation:

  • 485 combined OTel tests, package types, formatting and builds pass; handler bundles and 39 wiring tests also pass. Fallback checks control both clock sources while retaining exact event/span assertions; the final 28 affected tests and types pass.
  • Real public SDK captures for cases 6, 7, 8, 21, 22 and 23 pass every unchanged shared assertion in both views (12 checks). Case 21 exports eight execution-view or nine invocation-view spans with strict timing and replay counts.
  • Eighteen additional public SDK/local-tester cases cover callback/invoke success and failure, waits, intervening suspensions, subsequent replay, and startup updates under a completed child context. Focused tests cover update/hook ordering, terminal status/error fields, event timing and failed-invocation redelivery.
  • Shared negative tests reject absent context, wrong branch/trace and duplicate successful-replay exports. Invocation retry uses public at-most-once-per-retry and serializer APIs.
  • Normal PR CI runs all 24 cases in both views through ADOT/X-Ray and S3 against the exact SDK revision. Earlier revisions passed 96/96; the final combined revision requires its own CI results.

Related: #941; aws/aws-durable-execution-sdk-python#428; aws/aws-durable-execution-sdk-python#750.

@zhongkechen
zhongkechen requested a deployment to ai-pr-review-runtime October 2, 2026 23:58 — with GitHub Actions Waiting
@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 2, 2026 23:59 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 3, 2026 01:56 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen zhongkechen changed the title test(otel): exercise user function context and replay paths test: cover OTel replay and user function contexts Oct 3, 2026
@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 3, 2026 02:14 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 3, 2026 02:25 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 3, 2026 02:49 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 3, 2026 03:36 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 3, 2026 08:11 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 4, 2026 01:54 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 4, 2026 02:20 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 6, 2026 02:34 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 6, 2026 02:52 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 6, 2026 03:12 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen had a problem deploying to ai-pr-review-runtime October 6, 2026 19:23 — with GitHub Actions Failure
@zhongkechen
zhongkechen had a problem deploying to ai-pr-review-runtime October 6, 2026 22:23 — with GitHub Actions Failure
@zhongkechen
zhongkechen deployed to ai-pr-review-runtime October 7, 2026 02:04 — with GitHub Actions Active
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codex AI review

No actionable findings. Residual risk remains in the untested successful download/extraction and arm64 paths of the new Node bootstrap script.

Reviewed commit 277dfc5b9f1367989b13e0fdf52a5d3127ca9794. Workflow run

This branch was successfully deployed

1 active deployment
ai-pr-review-runtime — 277dfc5b Deployed Oct 7, 2026 by zhongkechen via ai-pr-review / Codex review / Generate Codex review #914
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.

1 participant