From 719f4c8399f54340f51aeb37c79035dfbc3cc749 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 21 Jul 2022 16:10:47 -0700 Subject: [PATCH] Switch death test to use explicit trap. (#11326) This change should make the test fail reliably, whereas the current approach is flaky and leads to not infrequent test failures. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Jake Hemstad (https://github.com/jrhemstad) - Nghia Truong (https://github.com/ttnghia) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cudf/pull/11326 --- cpp/tests/error/error_handling_test.cu | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cpp/tests/error/error_handling_test.cu b/cpp/tests/error/error_handling_test.cu index 9d8e0a7fe64..a83f72bb9c8 100644 --- a/cpp/tests/error/error_handling_test.cu +++ b/cpp/tests/error/error_handling_test.cu @@ -83,16 +83,13 @@ TEST(StreamCheck, CatchFailedKernel) "invalid configuration argument"); } -__global__ void kernel(int* p) { *p = 42; } +__global__ void kernel() { asm("trap;"); } TEST(DeathTest, CudaFatalError) { testing::FLAGS_gtest_death_test_style = "threadsafe"; auto call_kernel = []() { - int* p; - cudaMalloc(&p, 2 * sizeof(int)); - int* misaligned = (int*)(reinterpret_cast(p) + 1); - kernel<<<1, 1>>>(misaligned); + kernel<<<1, 1>>>(); try { CUDF_CUDA_TRY(cudaDeviceSynchronize()); } catch (const cudf::fatal_cuda_error& fe) {