Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit 0179c6c

Browse files
committed
changes
1 parent 618fe8f commit 0179c6c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

instrumentation/testing/init.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ func Init(m *testing.M) {
6969
var runPatch *mpatch.Patch
7070
var err error
7171
runPatch, err = mpatch.PatchMethodByReflect(tRunMethod, func(t *testing.T, name string, f func(t *testing.T)) bool {
72-
logOnError(runPatch.Unpatch())
73-
defer func() { logOnError(runPatch.Patch()) }()
7472
pc, _, _, _ := runtime.Caller(1)
73+
logOnError(runPatch.Unpatch())
74+
defer runPatch.Patch()
7575
return t.Run(name, func(childT *testing.T) {
76-
logOnError(runPatch.Patch())
77-
defer func() { logOnError(runPatch.Unpatch()) }()
76+
_ = runPatch.Patch()
7877
addAutoInstrumentedTest(childT)
7978
childTest := StartTestFromCaller(childT, pc)
8079
defer childTest.end()

0 commit comments

Comments
 (0)