Skip to content

fix: suppress specinfra Docker finalizer warnings#75

Merged
chorrell merged 1 commit into
mainfrom
fix-specinfra-finalizer-warning
May 27, 2026
Merged

fix: suppress specinfra Docker finalizer warnings#75
chorrell merged 1 commit into
mainfrom
fix-specinfra-finalizer-warning

Conversation

@chorrell
Copy link
Copy Markdown
Owner

Summary

  • Unregisters specinfra's Docker backend finalizer in delete_image before manually cleaning up containers
  • Eliminates the warning: Exception in finalizer noise seen in CI on both Ruby 3.4 and Ruby 4.0 jobs

Root cause

When set :docker_image is called, specinfra creates a container and registers an ObjectSpace finalizer to stop and delete it at process exit. Our delete_image helper already does that cleanup explicitly — so when the finalizer fires afterward, the containers are already gone and it raises an exception. Calling ObjectSpace.undefine_finalizer on the specinfra backend instance before our cleanup prevents the double-delete.

Test plan

  • CI passes without warning: Exception in finalizer lines in the "Run tests" step

🤖 Generated with Claude Code

Unregister specinfra's backend finalizer in delete_image before
manually cleaning up containers. Without this, the finalizer fires
at process exit and tries to stop/delete already-removed containers,
producing "warning: Exception in finalizer" noise in CI output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chorrell chorrell merged commit 8b4456d into main May 27, 2026
2 checks passed
@chorrell chorrell deleted the fix-specinfra-finalizer-warning branch May 27, 2026 14:19
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.

1 participant