Comments (7)
In production environment it's unlikely for the failpoint users to define a marker function in package main, But I think people incline to use such a simple test program to try failpint at first glimpse as I have done.
from failpoint.
@lonng as we've discussed yesterday.
from failpoint.
There is an imperfect solution here.
go run main.go binding__failpoint_binding__.go
from failpoint.
@lonng Yes.... if we want to solve this thoroughly, maybe there's one method, but I'm not sure if its graceful.
- generate
binding__failpoint_binding__.go
under packagegithub.com/pingcap/failpoint
asbinding__failpoint_binding_UNIQ_IDENTITY__.go
- rewrite the Marker function as
__curpkg_UNIQ_IDENTITY__()
......
from failpoint.
@spongedu I don't think put the generated files in github.com/pingcap/failpoint/
is a good idea.
We should investigate a more graceful solution, How about putting the _curpkg_
to the end of the file?
from failpoint.
So what about the extra import:
import "reflect"
?
from failpoint.
@spongedu Oops
from failpoint.
Related Issues (18)
- Is there any demo or userguide for failpoint? HOT 7
- go test failed HOT 8
- 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 not activated 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.