Skip to content

Fix flaky test caused by missing meck cleanup in CaptureSchemaTest#58

Merged
TheFirstAvenger merged 1 commit intomainfrom
fix/flaky-meck-cleanup-in-capture-schema-test
Feb 27, 2026
Merged

Fix flaky test caused by missing meck cleanup in CaptureSchemaTest#58
TheFirstAvenger merged 1 commit intomainfrom
fix/flaky-meck-cleanup-in-capture-schema-test

Conversation

@TheFirstAvenger
Copy link
Copy Markdown
Member

Summary

  • The "old code function passes" test in CaptureSchemaTest called :meck.new but never
    called :meck.unload, leaking a mock process across test modules
  • When CaptureSchemaTest ran before ServerTest (seed-dependent), ServerTest hit
    {:already_started, PID} trying to mock the same module
  • Added :meck.unload call to the test to clean up after itself
  • Reproduces consistently with --seed 173603, now passes

The "old code function passes" test created a meck mock for
ExampleModule but never unloaded it. When CaptureSchemaTest ran
before ServerTest (seed-dependent), the stale mock caused
ServerTest's mock_function test to fail with {:already_started, PID}.
@TheFirstAvenger TheFirstAvenger merged commit 7310fe5 into main Feb 27, 2026
1 check passed
@TheFirstAvenger TheFirstAvenger deleted the fix/flaky-meck-cleanup-in-capture-schema-test branch February 27, 2026 07:25
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