From 8e2589c7eadd4d1093bd4532b662a207d94f5780 Mon Sep 17 00:00:00 2001 From: TheFirstAvenger Date: Fri, 27 Feb 2026 02:18:02 -0500 Subject: [PATCH] Fix flaky test caused by missing meck cleanup in CaptureSchemaTest 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}. --- CHANGELOG.md | 1 + test/flame_on/component/capture_schema_test.exs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 051bb4a..3fcf48a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Update function heads to address type warnings - Add comprehensive tests - Widen gettext dependency to support 0.21.x and 1.0.x +- Fix flaky test caused by missing meck cleanup in CaptureSchemaTest ## 0.7.0 diff --git a/test/flame_on/component/capture_schema_test.exs b/test/flame_on/component/capture_schema_test.exs index 3ef1f46..1c634a8 100644 --- a/test/flame_on/component/capture_schema_test.exs +++ b/test/flame_on/component/capture_schema_test.exs @@ -48,6 +48,8 @@ defmodule FlameOn.Component.CaptureSchemaTest do true = :erlang.check_old_code(FlameOnTest.ExampleModule) assert %Changeset{valid?: true} = CaptureSchema.changeset(Node.self(), @valid_attrs) + + :meck.unload(FlameOnTest.ExampleModule) end end