Conversation
…ontainer tests The count_running_containers method fell back to counting ALL SAM CLI containers when MODE env var filtering found no matches. This caused AssertionError: 3 != 2 when stale containers from other tests were present. Changes: - Remove fallback that returned len(sam_containers) - now strictly returns only containers matching this test's unique MODE UUID - Use exact string matching instead of substring matching on env var
seshubaws
approved these changes
Feb 13, 2026
vicheey
approved these changes
Feb 13, 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.
Problem
TestWarmContainersHandlesSigTerm::test_can_invoke_lambda_function_successfullyfails intermittently withAssertionError: 3 != 2.The
count_running_containers()method in warm container integration tests had a fallback path: when theMODEenv var filtering found zero matching containers (e.g., due to a transient Docker API error duringcontainer.reload()), it fell back to returning the count of all running SAM CLI containers. If stale containers from other tests or parallel runs were present, this inflated the count.Fix
return len(sam_containers)— now strictly returns only the count of containers matching this test's uniqueMODEUUID==) instead of substring matching (in) on the env vartest_start_api.pyandtest_start_lambda.pyTesting
Verified via GitHub Actions workflow on fork — 14/14 warm container tests passed across two consecutive runs.