Skip to content

Commit

Permalink
poc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Deng committed Nov 1, 2023
1 parent 9d85e56 commit 09e9d49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;

import com.carrotsearch.randomizedtesting.annotations.Repeat;
import org.opensearch.action.admin.indices.refresh.RefreshRequest;
import org.opensearch.action.search.SearchResponse;
import org.opensearch.action.search.SearchType;
Expand Down Expand Up @@ -73,7 +74,7 @@
@OpenSearchIntegTestCase.SuiteScopeTestCase
public class DiversifiedSamplerIT extends ParameterizedOpenSearchIntegTestCase {

public static final int NUM_SHARDS = 2;
public static final int NUM_SHARDS = 1;

public DiversifiedSamplerIT(Settings dynamicSettings) {
super(dynamicSettings);
Expand All @@ -82,7 +83,7 @@ public DiversifiedSamplerIT(Settings dynamicSettings) {
@ParametersFactory
public static Collection<Object[]> parameters() {
return Arrays.asList(
new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), false).build() },
new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), true).build() },
new Object[] { Settings.builder().put(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING.getKey(), true).build() }
);
}
Expand Down Expand Up @@ -137,8 +138,9 @@ public void setupSuiteScopeCluster() throws Exception {
.setId("" + i)
.setSource("name", parts[2], "genre", parts[8], "price", Float.parseFloat(parts[3]))
.get();
client().admin().indices().refresh(new RefreshRequest("test")).get();
client().admin().indices().refresh(new RefreshRequest("idx_unmapped_author")).get();
}
client().admin().indices().refresh(new RefreshRequest("test")).get();
}

public void testIssue10719() throws Exception {
Expand Down Expand Up @@ -221,10 +223,10 @@ public void testNestedDiversity() throws Exception {
}

public void testNestedSamples() throws Exception {
assumeFalse(
"Concurrent search case muted pending fix: https://github.com/opensearch-project/OpenSearch/issues/10046",
internalCluster().clusterService().getClusterSettings().get(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING)
);
// assumeFalse(
// "Concurrent search case muted pending fix: https://github.com/opensearch-project/OpenSearch/issues/10046",
// internalCluster().clusterService().getClusterSettings().get(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING)
// );
// Test samples nested under samples
int MAX_DOCS_PER_AUTHOR = 1;
int MAX_DOCS_PER_GENRE = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ LeafSlice[] slicesInternal(List<LeafReaderContext> leaves, int targetMaxSlice) {
leafSlices = MaxTargetSliceSupplier.getSlices(leaves, targetMaxSlice);
logger.debug("Slice count using max target slice supplier [{}]", leafSlices.length);
}
logger.info("The length of the leaf slices is [{}]", leafSlices.length);
// if (leafSlices.length == 1) {
// logger.info("The length of the leaf slices is 1");
// throw new RuntimeException("The length of the leaf slices is 1");
// }
return leafSlices;
}
}

0 comments on commit 09e9d49

Please sign in to comment.