[fix(tests)] handle cleanup failures gracefully in failure-focused multicast tests #9743
+68
−14
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.
Fixes #9729
The test
test_multicast_group_dpd_communication_failure_recoverycan possibly panic during cleanup because it intentionally stops DPD to test failure recovery. When cleanup tries to simulate instance state transitions, the sled agent cannot communicate with the stopped DPD, causing a panic.The fix is to add fallible versions of simulation helpers for test cleanup:
try_vmm_finish_transitionin sled-agent-client: returns Result instead of panicking on communication failuretry_instance_simulatein instances.rs: wraps the fallible client method, includes VMM ID in error messages for debuggingThen, we update
cleanup_instancesandstop_instancesin multicast/mod.rs to use these versions for cleanup.I had a version of this in another PR, but that's still in review. Let's bring this in now.
Actual issues and true outcomes are still caught during test execution. Some cleanup failures are expected when tests intentionally break infrastructure.