e2e-framework
e2e-framework copied to clipboard
Execute "testenv.Finish" even when test panics
Currently we observe that "testenv.Finish" does not execute when the test ("testenv.Test") has a panic. Ideally, we want the testenv.Finish to execute regardless of test status (almost like a finally block of code in python) since we have cleanup written in this code block.
Also, is there a plan to add "BeforeTest" and "AfterTest" in the framework (not referring to BeforeEachTest or AfterEachTest) and the requirement would be "AfterTest" executes regardless of the test status as well.
Could you elaborate a bit more on what the difference between Before/AfterTest and Before/AfterEachTest would be?
@harshanarayana this sounds like we need some recover logic to catch hard panics (not just testing.Fatal)
A fix here may also be a fix for #188
@dapdelivery It would be nice if you could provide a simple example of this use case.
I confirm that if you get panic inside a test it will not run the testenv.Finish. In this case there is no way of running any cleanup when a panic occurs. I think this is related to the missing upstream functionality described here
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale - Close this issue with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle rotten - Close this issue with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten