Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: do cleanUp() always in the end
Fixes: kata-containers#1422 Detect failing test case: ``` .... === RUN TestEnterContainerFailingContNotStarted --- PASS: TestEnterContainerFailingContNotStarted (0.01s) === RUN TestEnterContainer --- FAIL: TestEnterContainer (0.00s) Error Trace: sandbox_test.go:1154 Error: Expected value not to be nil. Messages: Entering non-running container should fail Error Trace: sandbox_test.go:1157 Error: Expected nil, but got: &errors.errorString{s:"Can not move from running to running"} Messages: Failed to start sandbox: Can not move from running to running FAIL ``` `TestEnterContainerFailingContNotStarted` calls `cleanUp` at function begging but it doesn't clean its garbage after it ends. `TestEnterContainer` only call `cleanUp` in the end but it doesn't do cleanUp in the begging, that gives first test case a chance to impact latter one. This commit modifies all the test cases, let them all do the cleanUp() in the end. The policy here is: "everyone needs to take their garbage away when they leave" :) Signed-off-by: Wei Zhang <[email protected]>
- Loading branch information