bilibili / gengine

Other
1.95k stars 272 forks source link

在引入了gengine的package下面 无法使用gomonkey #27

Open jingqiyu opened 2 years ago

jingqiyu commented 2 years ago

必复现 --- FAIL: TestShakeEngine_DoShake (0.00s) panic: permission denied [recovered] panic: permission denied

goroutine 11 [running]: testing.tRunner.func1.1(0x494b2c0, 0xc00003f448) /usr/local/go/src/testing/testing.go:940 +0x2f5 testing.tRunner.func1(0xc0001fd680) /usr/local/go/src/testing/testing.go:943 +0x3f9 panic(0x494b2c0, 0xc00003f448) /usr/local/go/src/runtime/panic.go:969 +0x166 git.code.oa.com/NGTest/gomonkey.modifyBinary(0x46f5b90, 0xc0001185c4, 0xc, 0xc) /Users/jingqiyu/dev/go/pkg/mod/git.code.oa.com/!n!g!test/gomonkey@v1.0.0/modify_binary_darwin.go:11 +0x190 git.code.oa.com/NGTest/gomonkey.replace(0x46f5b90, 0x4a64ab0, 0x0, 0x0, 0x1) /Users/jingqiyu/dev/go/pkg/mod/git.code.oa.com/!n!g!test/gomonkey@v1.0.0/patch.go:197 +0xef git.code.oa.com/NGTest/gomonkey.(Patches).ApplyCore(0xc0000e1f38, 0x4914360, 0x4a64ad8, 0x13, 0x4914360, 0x4a64ab0, 0x13, 0x404da2c) /Users/jingqiyu/dev/go/pkg/mod/git.code.oa.com/!n!g!test/gomonkey@v1.0.0/patch.go:154 +0x14a git.code.oa.com/NGTest/gomonkey.(Patches).ApplyFunc(0xc000118738, 0x4914360, 0x4a64ad8, 0x4914360, 0x4a64ab0, 0xc000118748) /Users/jingqiyu/dev/go/pkg/mod/git.code.oa.com/!n!g!test/gomonkey@v1.0.0/patch.go:65 +0x130 git.code.oa.com/NGTest/gomonkey.ApplyFunc(...) /Users/jingqiyu/dev/go/pkg/mod/git.code.oa.com/!n!g!test/gomonkey@v1.0.0/patch.go:23 git.code.oa.com/submarine/activity/logic/monopoly_logic.TestShakeEngine_DoShake(0xc0001fd680) /Users/jingqiyu/dev/trpc/submarine/activity/logic/monopoly_logic/shake_test.go:23 +0xdc testing.tRunner(0xc0001fd680, 0x4a64ab8) /usr/local/go/src/testing/testing.go:991 +0xdc created by testing.(*T).Run /usr/local/go/src/testing/testing.go:1042 +0x357