Skip to content

Commit a295e7a

Browse files
authored
unmuting test & adding small variance to one of the int variables within testGetStatusFromStoredSearchWithNonEmptyClustersStillRunning to pass the needed test assertion (elastic#100812)
The issue with the failing test was that we're having an assertion within the test suite that relies on 3 randomly generated integers. The assertion states that the sum should be a strictly positive number, whereas the integers are drawn from the `[0, 10]` range. Since this seems to be only test-related, and IIUC is not an actual issue that we might have to deal with, in this PR we are adding small variance to one of the int variables in case all of them are 0 (+unmuting the test itself). Closes elastic#98706
1 parent 37de343 commit a295e7a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncStatusResponseTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ public void testGetStatusFromStoredSearchWithNonEmptyClustersSuccessfullyComplet
414414
);
415415
}
416416

417-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/98706")
418417
public void testGetStatusFromStoredSearchWithNonEmptyClustersStillRunning() {
419418
String searchId = randomSearchId();
420419

@@ -426,6 +425,16 @@ public void testGetStatusFromStoredSearchWithNonEmptyClustersStillRunning() {
426425
int successful = randomInt(10);
427426
int partial = randomInt(10);
428427
int skipped = randomInt(10);
428+
429+
if (successful + partial + skipped == 0) {
430+
int val = randomIntBetween(1, 10);
431+
switch (randomInt(2)) {
432+
case 0 -> successful = val;
433+
case 1 -> partial = val;
434+
case 2 -> skipped = val;
435+
default -> throw new UnsupportedOperationException();
436+
}
437+
}
429438
SearchResponse.Clusters clusters = AsyncSearchResponseTests.createCCSClusterObjects(100, 99, true, successful, skipped, partial);
430439

431440
SearchResponse searchResponse = new SearchResponse(

0 commit comments

Comments
 (0)