fix test cleanup: ignore deletion errors and propagate panics properly#27
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies the error handling in several test files, including bond, bridge, and vlan tests, by replacing standard assertions with std::panic::resume_unwind after cleanup steps. The reviewer identified a significant issue where the cleanup logic still utilizes exec_cmd, which panics on failure. If a test fails and the subsequent cleanup also fails, it will trigger a double-panic and cause a process abort, preventing the test runner from reporting the original failure. It is recommended to use a non-panicking command execution method for cleanup to ensure it remains best-effort and does not mask test results.
Replace assert-based cleanup with ignored deletion results and explicit panic propagation via resume_unwind. This ensures that cleanup failures don't mask test results, and panicked tests properly unwind through the cleanup code. Signed-off-by: Gris Ge <cnfourt@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace assert-based cleanup with straightforward deletion calls and
explicit panic propagation via resume_unwind. This ensures that
cleanup failures don't mask test results, and panicked tests properly
unwind through the cleanup code.