Skip to content

test: assert the invocation ID reaches the wire - #218

Merged
maxday merged 1 commit into
feat/invocation-id-cross-wiringfrom
maxday/unit-test-invocation-id
Jul 29, 2026
Merged

test: assert the invocation ID reaches the wire#218
maxday merged 1 commit into
feat/invocation-id-cross-wiringfrom
maxday/unit-test-invocation-id

Conversation

@maxday

@maxday maxday commented Jul 29, 2026

Copy link
Copy Markdown
Member

Description of changes:

Extends coverage of the invocation ID down to the wire, the existing tests patch runtime_client, so they cover the Python-level threading; this adds the layer where libcurl actually emits the header inside the compiled extension.

Adds 3 tests driving the built extension against a stub RAPID on a real socket (round trip, /error path, omission), in a dedicated test runtime client CI job that compiles the extension first, verified by removing the curl_slist_append call: these fail, the existing suite stays green.

Target (OCI, Managed Runtime, both):
both

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The existing tests all patch runtime_client, so they verify Python-level
argument threading but stop one layer above the behaviour. The header is
emitted by libcurl inside the compiled extension. If
aws-lambda-cpp-add-invocation-id.patch is dropped when the vendored tarball
is re-rolled, every test still passes and the feature silently disappears.

Add tests that drive the built extension against a stub RAPID on a real
socket, asserting on raw received headers: round trip via /response, the
/error path, and omission (no header at all, rather than an empty one).
Verified by removing the curl_slist_append call and rebuilding — the new
tests fail while the existing suite stays green.

The client half runs as a subprocess because post_invocation_result and
post_error hold the GIL across the blocking curl call, so an in-process stub
server thread would never be scheduled to answer the POST.
@maxday
maxday merged commit 689d09e into feat/invocation-id-cross-wiring Jul 29, 2026
35 checks passed
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