test: Check for device loss#9477
Open
andyleiserson wants to merge 1 commit intogfx-rs:trunkfrom
Open
Conversation
This does two things: 1. Installs a panicking device loss handler when running GPU tests. 2. Allows expect-failure cases looking for an "unexpected" driver error to match even when `internal_error_panic` is off. Normally, `cargo xtask test` runs with `--all-features`, enabling `internal_error_panic`, which always panics immediately on an unexpected driver error. To avoid confusion if running tests without that feature, also match such errors when the feature is disabled and they manifest as device loss.
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.
This does two things:
internal_error_panicis off.Normally,
cargo xtask testruns with--all-features, enablinginternal_error_panic, which always panics immediately on an unexpected driver error. To avoid confusion if running tests without that feature, also match such errors when the feature is disabled and they manifest as device loss.Tests should fail anyways if the device is lost, because polling the device will return an error. But in expect-fail cases where the harness is looking for a particular failure behavior, not panicking immediately means the test may throw other errors that do not directly reflect the cause of the device loss. Panicking on device loss seems like a reasonable default behavior, even if in most cases it doesn't matter. Tests can set their own callback if they want different behavior.
Testing
Tested locally with expect-fail MoltenVK tests.
Squash or Rebase? Squash
Checklist
wgpumay be affected behaviorally.CHANGELOG.mdentries for the user-facing effects of this change are present.