Skip to content

Conversation

Mandira783
Copy link

@Mandira783 Mandira783 commented Aug 13, 2025

Added unit tests for FuzzySet to check if FuzzySet is enabled and when it is enabled, it is calling FuzzyFilterPostingsFormat. If it is, then bloom filter is working when enabled. Also added few more unit test to test new codec.

Copy link
Contributor

❌ Gradle check result for 0b314d2: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Sep 12, 2025
Copy link
Contributor

❌ Gradle check result for dca8fea: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@Mandira783 Mandira783 changed the title Add bloom filter unit tests Unit Tests for Bloom Filter Enablement Sep 23, 2025
Copy link
Contributor

❌ Gradle check result for e1e84e1: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@opensearch-trigger-bot opensearch-trigger-bot bot removed the stalled Issues that have stalled label Sep 23, 2025
Copy link
Contributor

❌ Gradle check result for 946e372: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Mandira Ghosh <[email protected]>
Signed-off-by: Mandira Ghosh <[email protected]>
Signed-off-by: Mandira Ghosh <[email protected]>
Copy link
Contributor

❌ Gradle check result for 0d04e63: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

logger = mock(Logger.class);
}

public void testFuzzySetEnabled() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are only testing with Open search Current Version, are these feature only introduced in current version. if yes, can we add test on the behaviour of previous OS version, applicable for the below tests as well.


public void testBloomFilterSerializationDeserialization() throws IOException {
int elementCount = randomIntBetween(1, 100);
long maxDocs = elementCount * 10L; // Keeping this high so that it ensures some bits are not set.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removing these comments?

import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: please avoid wildcard imports

try (IndexWriter writer = new IndexWriter(dir, iwc)) {
for (int i = 0; i < 100; i++) {
Document doc = new Document();
doc.add(new TextField("field1", "value" + i, Field.Store.YES));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does fuzzy filter only work for TextField, can we also add cases with other field types?

}
long lookupTime = System.nanoTime() - startTime;

logger.info("Bloom filter performance - Insertion time: {} ns/item, Lookup time: {} ns/lookup", insertionTime / expectedItems, lookupTime / lookups);
Copy link
Contributor

@vishdivs vishdivs Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are just logging the performance log? since the expectedItems are defined, can we create an approx assertion on the lookups times? like time are in the range of 20-50% or less than 50% of baseline, can this lead to flaky test?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants