Skip to content

Commit e838a74

Browse files
opensearch-ci-botergunkezer1ergun-kezer
authored
fix testJVectorKnnIndex_simpleCase (#692) (#693)
* chore: fix flaky testJVectorKnnIndex_simpleCase test * doc: update changelog --------- (cherry picked from commit 65c0eef) Signed-off-by: ergun-kezer <ergun.kezer@ibm.com> Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com> Co-authored-by: Ergün Kezer <ergkezer@gmail.com> Co-authored-by: ergun-kezer <ergun.kezer@ibm.com>
1 parent cbaeee8 commit e838a74

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111

1212
### Bug Fixes
1313
- Fix flaky testJVectorKnnIndex_filter_maxInnerProduct test case [681](https://github.com/opensearch-project/opensearch-jvector/pull/681)
14+
- Fix flaky testJVectorKnnIndex_simpleCase test case [692](https://github.com/opensearch-project/opensearch-jvector/pull/692)
1415

1516
### Infrastructure
1617
### Documentation

src/test/java/org/opensearch/knn/index/codec/jvector/KNNJVectorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void testJVectorKnnIndex_simpleCase() throws IOException {
9494
try (IndexReader reader = DirectoryReader.open(w)) {
9595
int expectedNumOfSegments = indexWriterConfig.getMaxBufferedDocs() < 0 ? 1
9696
: totalNumberOfDocs > indexWriterConfig.getMaxBufferedDocs()
97-
? totalNumberOfDocs / indexWriterConfig.getMaxBufferedDocs() + 1
97+
? Math.ceilDiv(totalNumberOfDocs, indexWriterConfig.getMaxBufferedDocs())
9898
: 1;
9999
log.info("We should now have a {} segment(s) with 10 documents", expectedNumOfSegments);
100100
Assert.assertEquals(expectedNumOfSegments, reader.getContext().leaves().size());

0 commit comments

Comments
 (0)