Verify watch_count before a test starts and not after a test.
This check was added as part of: 0f2d26bdca
Checking this before the test starts makes more sense, because
the watches index has then also be removed.
Relates to #53177
This commit is contained in:
parent
5e96d3e59a
commit
7775ddbc9c
|
@ -53,6 +53,8 @@ public abstract class WatcherYamlSuiteTestCase extends ESClientYamlSuiteTestCase
|
||||||
case "starting":
|
case "starting":
|
||||||
throw new AssertionError("waiting until starting state reached started state");
|
throw new AssertionError("waiting until starting state reached started state");
|
||||||
case "started":
|
case "started":
|
||||||
|
int watcherCount = (int) response.evaluate("stats.0.watch_count");
|
||||||
|
assertThat(watcherCount, equalTo(0));
|
||||||
// all good here, we are done
|
// all good here, we are done
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -70,8 +72,6 @@ public abstract class WatcherYamlSuiteTestCase extends ESClientYamlSuiteTestCase
|
||||||
String state = (String) response.evaluate("stats.0.watcher_state");
|
String state = (String) response.evaluate("stats.0.watcher_state");
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case "stopped":
|
case "stopped":
|
||||||
int watcherCount = (int) response.evaluate("stats.0.watch_count");
|
|
||||||
assertThat(watcherCount, equalTo(0));
|
|
||||||
// all good here, we are done
|
// all good here, we are done
|
||||||
break;
|
break;
|
||||||
case "stopping":
|
case "stopping":
|
||||||
|
|
Loading…
Reference in New Issue