Bug Report
func GetValue() int {
if _, _err_ := failpoint.Eval(_curpkg_("failpoint-name")); _err_ == nil {
fmt.Println("enable failpoint")
}
return 1
}
func TestGetValue(t *testing.T) {
var err error
fmt.Println("############case01###############")
err = failpoint.Enable("test/failpoint-name", "return(true)->off")
if err != nil {
t.Fatal("enable failpoint failed:", err)
}
GetValue()
fmt.Println("############case02###############")
err = failpoint.Enable("test/failpoint-name", "off")
if err != nil {
t.Fatal("enable failpoint failed:", err)
}
GetValue()
fmt.Println("############case03###############")
err = failpoint.Enable("test/failpoint-name", "return(2)")
if err != nil {
t.Fatal("enable failpoint failed:", err)
}
GetValue()
}
- EXPECT:
According to README, "off: Take no action (does not trigger failpoint code)", used to stop triggering of the failpoint. So my expectation is that case02 and case03 should not print "enable failpoint".
- ACTUAL:
It seems no working. I'm not sure if I'm misunderstanding this argument.
go test -v -run TestGetValue
=== RUN TestGetValue
############case01###############
enable failpoint
############case02###############
enable failpoint
############case03###############
enable failpoint
--- PASS: TestGetValue (0.00s)
Bug Report
According to README, "off: Take no action (does not trigger failpoint code)", used to stop triggering of the failpoint. So my expectation is that case02 and case03 should not print "enable failpoint".
It seems no working. I'm not sure if I'm misunderstanding this argument.