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:
Martijn van Groningen 2020-03-06 14:53:19 +01:00
parent 5e96d3e59a
commit 7775ddbc9c
No known key found for this signature in database
GPG Key ID: AB236F4FCF2AF12A
1 changed files with 2 additions and 2 deletions

View File

@ -53,6 +53,8 @@ public abstract class WatcherYamlSuiteTestCase extends ESClientYamlSuiteTestCase
case "starting":
throw new AssertionError("waiting until starting state reached started state");
case "started":
int watcherCount = (int) response.evaluate("stats.0.watch_count");
assertThat(watcherCount, equalTo(0));
// all good here, we are done
break;
default:
@ -70,8 +72,6 @@ public abstract class WatcherYamlSuiteTestCase extends ESClientYamlSuiteTestCase
String state = (String) response.evaluate("stats.0.watcher_state");
switch (state) {
case "stopped":
int watcherCount = (int) response.evaluate("stats.0.watch_count");
assertThat(watcherCount, equalTo(0));
// all good here, we are done
break;
case "stopping":