Skip to content

Commit

Permalink
Only query for watcher history docs with the expected state,
Browse files Browse the repository at this point in the history
otherwise other history docs can be returned, which may not
have the expected state, and this test only checks the first hit.

Relates to #30777
  • Loading branch information
martijnvg committed Jan 29, 2020
1 parent 69ec669 commit 14332b5
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,7 @@ public void testSearchInputWithInsufficientPrivileges() throws Exception {
}

// check history, after watch has fired
ObjectPath objectPath = getWatchHistoryEntry(watchId);
assertBusy(() -> {
String state = objectPath.evaluate("hits.hits.0._source.state");
assertThat(state, is("execution_not_needed"));
});
ObjectPath objectPath = getWatchHistoryEntry(watchId, "execution_not_needed");
boolean conditionMet = objectPath.evaluate("hits.hits.0._source.result.condition.met");
assertThat(conditionMet, is(false));
}
Expand Down

0 comments on commit 14332b5

Please sign in to comment.