DawnTest: Prevent infinite loops in DawnTest.

WaitABit waits forever should a device loss occurs, which
happens when a bug is introduced. This can lock up the console
preventing debugging when needed the most.

Bug: dawn:495
Change-Id: I0b13ddfa75abbb9c43f7dd545fa9c41be79a697c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25960
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
This commit is contained in:
Enrico Galli 2020-08-08 01:05:59 +00:00 committed by Commit Bot service account
parent 2cf5a08cfc
commit 101a5829d5
1 changed files with 4 additions and 1 deletions

View File

@ -892,7 +892,10 @@ void DawnTestBase::OnDeviceError(WGPUErrorType type, const char* message, void*
}
void DawnTestBase::OnDeviceLost(const char* message, void* userdata) {
FAIL() << "Device Lost during test: " << message;
// Using ADD_FAILURE + ASSERT instead of FAIL to prevent the current test from continuing with a
// corrupt state.
ADD_FAILURE() << "Device Lost during test: " << message;
ASSERT(false);
}
std::ostringstream& DawnTestBase::AddBufferExpectation(const char* file,