Skip to content

Commit

Permalink
Fix error message to print expected and actual doc counts.
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <handalm@amazon.com>
  • Loading branch information
mch2 committed Jan 26, 2023
1 parent 030a6e1 commit 66f9042
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,9 @@ private void waitForSearchableDocs(long docCount, List<String> nodes) throws Exc
assertBusy(() -> {
for (String node : nodes) {
final SearchResponse response = client(node).prepareSearch(INDEX_NAME).setSize(0).setPreference("_only_local").get();
if (response.getHits().getTotalHits().value < docCount) {
fail("Expected search hits on node: " + node + " to be at least " + docCount);
final long hits = response.getHits().getTotalHits().value;
if (hits < docCount) {
fail("Expected search hits on node: " + node + " to be at least " + docCount + " but was: " + hits);
}
}
}, 1, TimeUnit.MINUTES);
Expand Down

0 comments on commit 66f9042

Please sign in to comment.