From b17fe99e8bbf14699b35a028948802fee6bea625 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 2 Dec 2020 18:06:30 +0000 Subject: [PATCH] Do not assert in work thread during tests If there is an issue with the shader, i.e. validation failing, the former ASSERT_EQs will kill the thread that is running the lambda. Since the main thread is waiting for a state change, if this assert kills the thread, the test will hang forever. This change allows the test to complete and fail correctly in the case that the test condition fails. Bug: tint:578 Change-Id: I6f5cc636193bf01c2d5e5d77a883fab7ec591c3e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34700 Auto-Submit: Ryan Harrison Reviewed-by: Austin Eng Reviewed-by: Corentin Wallez Commit-Queue: Corentin Wallez --- src/tests/end2end/CreateReadyPipelineTests.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/end2end/CreateReadyPipelineTests.cpp b/src/tests/end2end/CreateReadyPipelineTests.cpp index 7a8f673244..95131e4e4f 100644 --- a/src/tests/end2end/CreateReadyPipelineTests.cpp +++ b/src/tests/end2end/CreateReadyPipelineTests.cpp @@ -49,7 +49,7 @@ TEST_P(CreateReadyPipelineTest, BasicUseOfCreateReadyComputePipeline) { &csDesc, [](WGPUCreateReadyPipelineStatus status, WGPUComputePipeline returnPipeline, const char* message, void* userdata) { - ASSERT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_Success, status); + EXPECT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_Success, status); CreateReadyPipelineTask* task = static_cast(userdata); task->computePipeline = wgpu::ComputePipeline::Acquire(returnPipeline); @@ -116,7 +116,7 @@ TEST_P(CreateReadyPipelineTest, CreateComputePipelineFailed) { &csDesc, [](WGPUCreateReadyPipelineStatus status, WGPUComputePipeline returnPipeline, const char* message, void* userdata) { - ASSERT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_Error, status); + EXPECT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_Error, status); CreateReadyPipelineTask* task = static_cast(userdata); task->computePipeline = wgpu::ComputePipeline::Acquire(returnPipeline); @@ -164,7 +164,7 @@ TEST_P(CreateReadyPipelineTest, BasicUseOfCreateReadyRenderPipeline) { &renderPipelineDescriptor, [](WGPUCreateReadyPipelineStatus status, WGPURenderPipeline returnPipeline, const char* message, void* userdata) { - ASSERT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_Success, status); + EXPECT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_Success, status); CreateReadyPipelineTask* task = static_cast(userdata); task->renderPipeline = wgpu::RenderPipeline::Acquire(returnPipeline); @@ -241,7 +241,7 @@ TEST_P(CreateReadyPipelineTest, CreateRenderPipelineFailed) { &renderPipelineDescriptor, [](WGPUCreateReadyPipelineStatus status, WGPURenderPipeline returnPipeline, const char* message, void* userdata) { - ASSERT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_Error, status); + EXPECT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_Error, status); CreateReadyPipelineTask* task = static_cast(userdata); task->renderPipeline = wgpu::RenderPipeline::Acquire(returnPipeline); @@ -275,7 +275,7 @@ TEST_P(CreateReadyPipelineTest, ReleaseDeviceBeforeCallbackOfCreateReadyComputeP &csDesc, [](WGPUCreateReadyPipelineStatus status, WGPUComputePipeline returnPipeline, const char* message, void* userdata) { - ASSERT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_DeviceDestroyed, + EXPECT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_DeviceDestroyed, status); CreateReadyPipelineTask* task = static_cast(userdata); @@ -316,7 +316,7 @@ TEST_P(CreateReadyPipelineTest, ReleaseDeviceBeforeCallbackOfCreateReadyRenderPi &renderPipelineDescriptor, [](WGPUCreateReadyPipelineStatus status, WGPURenderPipeline returnPipeline, const char* message, void* userdata) { - ASSERT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_DeviceDestroyed, + EXPECT_EQ(WGPUCreateReadyPipelineStatus::WGPUCreateReadyPipelineStatus_DeviceDestroyed, status); CreateReadyPipelineTask* task = static_cast(userdata);