Comments (2)
Add the package name of foo.go
before the failpoint label name when you call failpoint.Enable
will probably fix your problem.
$ cat test.go
package main
import "github.com/pingcap/failpoint"
func main() {
failpoint.Enable("main/testPanic", "return(true)")
if _, ok := failpoint.Eval(_curpkg_("testPanic")); ok {
panic("failpoint triggerd")
}
}
$ failpoint-ctl enable
$ go run ./
panic: failpoint triggerd
goroutine 1 [running]:
main.main()
/root/test-go/test.go:8 +0xe5
exit status 2
from failpoint.
Closed as stale and answered.
Please provide a complete repro if the problem is still relevant.
from failpoint.
Related Issues (18)
- Is there any demo or userguide for failpoint? HOT 7
- go test failed HOT 8
- failpoint doesn't work if the marker function is defined in the main package HOT 7
- failpoint can not use a constant-string as marker function name HOT 4
- Add a "DO NOT EDIT" comment to failpoint-enabled source code HOT 2
- failpoint in anonymous function can not be enable
- type assert OK print error message
- Create Release Binary amd and Darwin HOT 2
- Why the type of failpoint.Value can't be string HOT 2
- Register an action func to be called when a failpoint is evaluated
- Why do we call `fmt.Println` in `failpoints.Eval` HOT 1
- How to inject faults to a program at running time with failpoint HOT 2
- Failpoint doesn't work when Inject function defined in a closure argument
- failpoint can be actived if it is injected with in a function clusure HOT 1
- failpoint.Disable should be idempotent HOT 1
- Failpoints are getting executed while running tests using `go test -v`
- Failpoints.Disable not remove failpath from fps.reg HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from failpoint.