We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After panic recovery and performing of finish steps tests are not marked as failed
After panic I expect tests to be marked as failed ones
func TestMain(m *testing.M) { testEnv := env.New() testEnv.Setup( causePanic(), ) os.Exit(testEnv.Run(m)) } func causePanic() env.Func { return func(ctx context.Context, config *envconf.Config) (context.Context, error) { panic("aaaaa") return ctx, nil } }
this code will cause panic and recover but exit code of go test command will be 0 and tests will be reported as ok
go test
ok
No response
kind
e2e-framework
0.3.0
any
The text was updated successfully, but these errors were encountered:
@StupidScience This is a nice catch. Thanks for bug report.
❯ go test -v . E1026 17:27:03.045149 58234 env.go:361] Recovering from panic and running finish actions: aaaaa, stack: goroutine 1 [running]: runtime/debug.Stack() /Users/harshnar/.gvm/gos/go1.19/src/runtime/debug/stack.go:24 +0x65 sigs.k8s.io/e2e-framework/pkg/env.(*testEnv).Run.func1() /Users/harshnar/Work/Tesseract/Maglev/mks/k8s/e2e-framework/pkg/env/env.go:361 +0x9b panic({0x2075d40, 0x24d1f30}) /Users/harshnar/.gvm/gos/go1.19/src/runtime/panic.go:884 +0x212 sigs.k8s.io/e2e-framework/examples/panictest.TestMain.func1({0xc000171c98?, 0x1050e74?}, 0x50?) /Users/harshnar/Work/Tesseract/Maglev/mks/k8s/e2e-framework/examples/panictest/main_test.go:23 +0x27 sigs.k8s.io/e2e-framework/pkg/env.(*action).run(0x21972e0?, {0x24ea050?, 0xc000128008?}, 0xc00048c800) /Users/harshnar/Work/Tesseract/Maglev/mks/k8s/e2e-framework/pkg/env/action.go:135 +0xea sigs.k8s.io/e2e-framework/pkg/env.(*testEnv).Run(0xc000171e88, 0xc0004a86b0?) /Users/harshnar/Work/Tesseract/Maglev/mks/k8s/e2e-framework/pkg/env/env.go:379 +0x217 sigs.k8s.io/e2e-framework/examples/panictest.TestMain(0xffffffffffffffff?) /Users/harshnar/Work/Tesseract/Maglev/mks/k8s/e2e-framework/examples/panictest/main_test.go:18 +0x9d main.main() _testmain.go:49 +0x1d3 FAIL sigs.k8s.io/e2e-framework/examples/panictest 1.420s FAIL
I believe this is what you are expecting to happen ?
Sorry, something went wrong.
@harshanarayana hard to tell but on first sight looks correct.
Successfully merging a pull request may close this issue.
What happened?
After panic recovery and performing of finish steps tests are not marked as failed
What did you expect to happen?
After panic I expect tests to be marked as failed ones
How can we reproduce it (as minimally and precisely as possible)?
this code will cause panic and recover but exit code of
go test
command will be 0 and tests will be reported asok
Anything elese we need to know?
No response
E2E Provider Used
kind
e2e-framework
Version0.3.0
OS version
any
The text was updated successfully, but these errors were encountered: