test: assert the invocation ID reaches the wire - #218
Merged
maxday merged 1 commit intoJul 29, 2026
Conversation
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.
vip-amzn
approved these changes
Jul 29, 2026
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.
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.