From 4051577d6b037e9d9dbeaa8817b906f7b3a8eb26 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 4 Sep 2025 04:51:49 +0900 Subject: container/stub: override goexit methods FailNow, Fatal, Fatalf, SkipNow, Skip and Skipf must be called from the goroutine created by the test. Signed-off-by: Ophestra --- system/dispatcher_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system') diff --git a/system/dispatcher_test.go b/system/dispatcher_test.go index e5b703f6..7fbb75c2 100644 --- a/system/dispatcher_test.go +++ b/system/dispatcher_test.go @@ -43,8 +43,8 @@ func checkOpBehaviour(t *testing.T, testCases []opBehaviourTestCase) { ec = (*Criteria)(&tc.ec) } - defer stub.HandleExit() sys, s := InternalNew(t, stub.Expect{Calls: slices.Concat(tc.apply, []stub.Call{{Name: stub.CallSeparator}}, tc.revert)}, tc.uid) + defer s.HandleExit() errApply := tc.op.apply(sys) s.Expects(stub.CallSeparator) if !reflect.DeepEqual(errApply, tc.wantErrApply) { @@ -90,8 +90,8 @@ func checkOpsBuilder(t *testing.T, fname string, testCases []opsBuilderTestCase) t.Run(tc.name, func(t *testing.T) { t.Helper() - defer stub.HandleExit() sys, s := InternalNew(t, tc.exp, tc.uid) + defer s.HandleExit() tc.f(sys) s.VisitIncomplete(func(s *stub.Stub[syscallDispatcher]) { t.Helper() -- cgit v1.3.1