Skip to content

Commit

Permalink
Avoid running sanitizer on Java test designed to cause an error (#15753)
Browse files Browse the repository at this point in the history
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: #15753
  • Loading branch information
jlowe authored May 15, 2024
1 parent c5c95b7 commit 0811523
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion java/src/test/java/ai/rapids/cudf/CudaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0811523

Please sign in to comment.