Make unit/integ tests more reliable#2353
Merged
normj merged 6 commits intofeature/response-streamingfrom May 5, 2026
Merged
Conversation
GarrettBeatty
approved these changes
May 5, 2026
philasmar
approved these changes
May 5, 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:
Work on making the tests more reliable and PR checks succeed without retries. After the PR changes I was able to run the PR checks 5 times in a row with no issues.
Changes:
OnCompletedCallback_IsExecutedinteg test. The test was relying on making a second invoke to Lambda see if a state variable was set from previous run. There is no way to guarantee the second invokes will go to the same Lambda compute instance. The scenario being tested was checking if the ASP.NET Core OnComplete callbacks are called. But the OnComplete callbacks don't have access to the response stream so there is no way to write something back to the caller to say I was called. Hence the reason the AI generated integ test relied on the second call. The fact that the test did pass when the invokes did go to same Lambda compute environment show the feature does work but we don't want to have this flaky test.ResponseStreamFactorycollection toRuntimeSupportStateCheckand applied it to more tests that are testing RuntimeSupport so they would not run in parallel. RuntimeSupport has logic via statics that assume there is only a single instance running a single invocation. All these unit tests run under a few seconds so I'm not worried about tests not running in parallelLambdaBootstrapto pass in mock environment variable collections to avoid bleeding environment variable between tests.MidstreamError_SetsErrorStateWithExceptionDetailsunit test. There were too many issues mock of the runtime api to get the timing a 100% right. The scenario being tested is covered in integ tests.I also removed the .NET 11 targets from RuntimeSupport and SnapShotRestore because we don't need it for OCI images and it was causing issues building in VS.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.