Skip to content

Commit

Permalink
unmuting test & adding small variance to one of the int variables wit…
Browse files Browse the repository at this point in the history
…hin 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
  • Loading branch information
pmpailis authored Oct 13, 2023
1 parent 37de343 commit a295e7a
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ public void testGetStatusFromStoredSearchWithNonEmptyClustersSuccessfullyComplet
);
}

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

Expand All @@ -426,6 +425,16 @@ public void testGetStatusFromStoredSearchWithNonEmptyClustersStillRunning() {
int successful = randomInt(10);
int partial = randomInt(10);
int skipped = randomInt(10);

if (successful + partial + skipped == 0) {
int val = randomIntBetween(1, 10);
switch (randomInt(2)) {
case 0 -> successful = val;
case 1 -> partial = val;
case 2 -> skipped = val;
default -> throw new UnsupportedOperationException();
}
}
SearchResponse.Clusters clusters = AsyncSearchResponseTests.createCCSClusterObjects(100, 99, true, successful, skipped, partial);

SearchResponse searchResponse = new SearchResponse(
Expand Down

0 comments on commit a295e7a

Please sign in to comment.