Skip to content

[BUG] cuvs-java com.nvidia.cuvs.CagraRandomizedTest.testResultsTopKWithRandomValues test fails intermittently #631

Open

Description

@ChrisHegarty

Describe the bug
cuvs-java test fails intermittently, e.g.

[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.031 s <<< FAILURE! -- in com.nvidia.cuvs.CagraRandomizedTest
[ERROR] com.nvidia.cuvs.CagraRandomizedTest.testResultsTopKWithRandomValues -- Time elapsed: 2.031 s <<< FAILURE!
java.lang.AssertionError: Not found in expected list: 1583
  at __randomizedtesting.SeedInfo.seed([93DF604C314D221A:BAF3BCD46F1EDC5A]:0)
  at org.junit.Assert.fail(Assert.java:89)
  at org.junit.Assert.assertTrue(Assert.java:42)
  at com.nvidia.cuvs/com.nvidia.cuvs.CuVSTestCase.compareResults(CuVSTestCase.java:83)
  at com.nvidia.cuvs/com.nvidia.cuvs.CagraRandomizedTest.tmpResultsTopKWithRandomValues(CagraRandomizedTest.java:98)
  at com.nvidia.cuvs/com.nvidia.cuvs.CagraRandomizedTest.testResultsTopKWithRandomValues(CagraRandomizedTest.java:29)
  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
  at java.base/java.lang.reflect.Method.invoke(Method.java:580)
...

Steps/Code to reproduce bug
It's not clear if setting the random seed (-Dtests.seed) actually improves reproducibility.

./build java
cd java/cuvs-java
mvn -Dtests.seed=93DF604C314D221A test

Expected behavior
The test passes successfully every time.

Environment details (please complete the following information):

  • Environment location: [Bare-metal, Docker, Cloud(specify cloud provider)]
    • AWS g4dn.2xlarge, Ubuntu 22.04 + cuda 12.6
  • Method of RAFT install: [conda, Docker, or from source]
    • If method of install is [Docker], provide docker pull & docker run commands used

set the JAVA_HOME env variable to JDK 22

JAVA_HOME=/home/ubuntu/binaries/jdk-22.0.2/

Additional context
This fails in branch-25.02, with the commit that added the java-api:

commit 4ca47c92b03856e7d4ae328aabf6ee3e853a137e (...

Initial cut for a cuVS Java API (#450)
    
A Java API for cuVS for easy integration into Apache Lucene or other Java based projects.

Activity

  1. ChrisHegarty commented on Jan 31, 2025

    @ChrisHegarty
    ContributorAuthor
  2. bdice commented on Oct 11, 2026

    @bdice
    Contributor

    Root cause analysis from the flaky-test sweep (#2783):

    #2830 re-enables CagraRandomizedIT. For every query it checks distinct, valid ids, no rows excluded by the prefilter, sorted exact distances, and that a copy of a row is returned first. It checks recall only as a mean per memory kind, with bounds set from about 300 test runs measured in CI. While re-enabling the test it also found and fixed a third bindings bug: a prefilter that excludes every row was treated as "no filter". 400 CI runs of the new test (about 120,000 random cases) had no failures: https://github.com/NVIDIA/cuvs/actions/runs/38138513521

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions