Skip to content

Commit 8c78404

Browse files
committed
Only query for watcher history docs with the expected state,
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
1 parent e0e35b7 commit 8c78404

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

x-pack/qa/smoke-test-watcher-with-security/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,7 @@ public void testSearchInputWithInsufficientPrivileges() throws Exception {
181181
}
182182

183183
// check history, after watch has fired
184-
ObjectPath objectPath = getWatchHistoryEntry(watchId);
185-
String state = objectPath.evaluate("hits.hits.0._source.state");
186-
assertThat(state, is("execution_not_needed"));
184+
ObjectPath objectPath = getWatchHistoryEntry(watchId, "execution_not_needed");
187185
boolean conditionMet = objectPath.evaluate("hits.hits.0._source.result.condition.met");
188186
assertThat(conditionMet, is(false));
189187
}

0 commit comments

Comments
 (0)