From 08115239ad1f5155108430e0d0ac2f747f4bbd59 Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Wed, 15 May 2024 11:29:22 -0500 Subject: [PATCH] Avoid running sanitizer on Java test designed to cause an error (#15753) Fixes NVIDIA/spark-rapids-jni#2039. CudaTest#testCudaException causes the compute-sanitizer to fail the test because it (correctly) flags an invalid argument being passed to a CUDA runtime call. Updated the tagging for the test to avoid running it under the compute-sanitizer. Authors: - Jason Lowe (https://github.com/jlowe) Approvers: - Nghia Truong (https://github.com/ttnghia) - Gera Shegalov (https://github.com/gerashegalov) URL: https://github.com/rapidsai/cudf/pull/15753 --- java/src/test/java/ai/rapids/cudf/CudaTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/src/test/java/ai/rapids/cudf/CudaTest.java b/java/src/test/java/ai/rapids/cudf/CudaTest.java index 9aaa9cee916..a741b0a5e31 100644 --- a/java/src/test/java/ai/rapids/cudf/CudaTest.java +++ b/java/src/test/java/ai/rapids/cudf/CudaTest.java @@ -16,6 +16,7 @@ package ai.rapids.cudf; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -33,13 +34,14 @@ public void testGetCudaRuntimeInfo() { assertEquals(Cuda.getNativeComputeMode(), Cuda.getComputeMode().nativeId); } + @Tag("noSanitizer") @Test public void testCudaException() { assertThrows(CudaException.class, () -> { try { Cuda.freePinned(-1L); } catch (CudaFatalException fatalEx) { - throw new AssertionError("Expected UnFatalError but got FatalError: " + fatalEx); + throw new AssertionError("Expected CudaException but got fatal error", fatalEx); } catch (CudaException ex) { assertEquals(CudaException.CudaError.cudaErrorInvalidValue, ex.getCudaError()); throw ex;