Skip to content

Restore layer test tearDown image cleanup removed in #8666#8687

Merged
roger-zhangg merged 5 commits intodevelopfrom
layer_fix
Feb 23, 2026
Merged

Restore layer test tearDown image cleanup removed in #8666#8687
roger-zhangg merged 5 commits intodevelopfrom
layer_fix

Conversation

@roger-zhangg
Copy link
Member

Re-add the samcli/lambda-* Docker image cleanup in tearDown for TestLayerVersionBase and TestLayerVersionThatDoNotCreateCache.

This was removed in PR #8666 to avoid cross-test interference in parallel runs, but these test classes are already serialized via xdist_group markers. Without the cleanup, stale cached images cause layer version tests to use outdated layers.

Changes:

  • Add _cleanup_samcli_images static method to TestLayerVersionBase that removes all samcli/lambda-* images
  • Restore tearDown in TestLayerVersionBase to call the cleanup + clear layer cache
  • Restore tearDown in TestLayerVersionThatDoNotCreateCache to clean up images
  • Add comment noting these tests can't run in parallel

Re-add the samcli/lambda-* Docker image cleanup in tearDown for
TestLayerVersionBase and TestLayerVersionThatDoNotCreateCache.

This was removed in PR #8666 to avoid cross-test interference in
parallel runs, but these test classes are already serialized via
xdist_group markers. Without the cleanup, stale cached images
cause layer version tests to use outdated layers.
@roger-zhangg roger-zhangg requested a review from a team as a code owner February 23, 2026 17:45
vicheey
vicheey previously approved these changes Feb 23, 2026
@roger-zhangg
Copy link
Member Author

there was dep issue: psf/requests#7222
Now we need to pin chardet version to <6 for compatibility with request lib

@roger-zhangg roger-zhangg added this pull request to the merge queue Feb 23, 2026
Merged via the queue into develop with commit e612f3b Feb 23, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants