container/stub: remove function call in handleExit
All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m10s
Test / Hakurei (push) Successful in 3m5s
Test / Hpkg (push) Successful in 3m59s
Test / Sandbox (race detector) (push) Successful in 4m27s
Test / Hakurei (race detector) (push) Successful in 5m7s
Test / Flake checks (push) Successful in 1m28s

This gets inlined and does not cause problems usually but turns out -coverpkg uninlines it and breaks the recovery.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-09-04 19:39:12 +09:00
parent 25db474cf6
commit 11bd0797f5
6 changed files with 57 additions and 35 deletions

View File

@@ -149,7 +149,7 @@ func checkSimple(t *testing.T, fname string, testCases []simpleTestCase) {
t.Helper()
k := &kstub{stub.New(t, func(s *stub.Stub[syscallDispatcher]) syscallDispatcher { return &kstub{s} }, tc.want)}
defer k.HandleExit()
defer stub.HandleExit(t)
if err := tc.f(k); !reflect.DeepEqual(err, tc.wantErr) {
t.Errorf("%s: error = %v, want %v", fname, err, tc.wantErr)
}
@@ -189,7 +189,7 @@ func checkOpBehaviour(t *testing.T, testCases []opBehaviourTestCase) {
func(s *stub.Stub[syscallDispatcher]) syscallDispatcher { return &kstub{s} },
stub.Expect{Calls: slices.Concat(tc.early, []stub.Call{{Name: stub.CallSeparator}}, tc.apply)},
)}
defer k.HandleExit()
defer stub.HandleExit(t)
errEarly := tc.op.early(state, k)
k.Expects(stub.CallSeparator)
if !reflect.DeepEqual(errEarly, tc.wantErrEarly) {