Skip to content

Commit

Permalink
Randomize spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luigidellaquila committed Nov 11, 2024
1 parent 18cfa60 commit 8777fc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,19 @@ protected ObjectPath runQuery(String index, String query) throws Exception {
if (maxSamplesPerKey > 0) {
builder.field("max_samples_per_key", maxSamplesPerKey);
}
if (randomBoolean()) {
builder.field("allow_partial_search_results", randomBoolean());
}
builder.endObject();

Request request = new Request("POST", "/" + index + "/_eql/search");
Boolean ccsMinimizeRoundtrips = ccsMinimizeRoundtrips();
if (ccsMinimizeRoundtrips != null) {
request.addParameter("ccs_minimize_roundtrips", ccsMinimizeRoundtrips.toString());
}
if (randomBoolean()) {
request.addParameter("allow_partial_search_results", String.valueOf(randomBoolean()));
}
int timeout = Math.toIntExact(timeout().millis());
RequestConfig config = RequestConfig.copy(RequestConfig.DEFAULT)
.setConnectionRequestTimeout(timeout)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void testPartialResults() throws Exception {
request = new EqlSearchRequest().indices("test-*").query("sequence [process where value == 0] [process where value == 2]");
shouldFail(request);

// sequence query with missing event on unavailable shard. THIS IS A FALSE POSITIVE
// sequence query with missing event on unavailable shard.
request = new EqlSearchRequest().indices("test-*")
.query("sequence with maxspan=10s [process where value == 1] ![process where value == 2] [process where value == 3]");
shouldFail(request);
Expand Down

0 comments on commit 8777fc8

Please sign in to comment.