在引入了gengine的package下面 无法使用gomonkey
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 281
- PR merge metrics
- No merged PRs in 30d
Description
必复现
--- 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
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running TestShakeEngine_DoShake in activity/logic/monopoly_logic/shake_test.go and compare the failure with gomonkey's modify_binary_darwin.go and patch.go stack frames. Trace how importing gengine affects the test setup; done means the reproduced permission-denied panic is understood and the test no longer fails in this configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100