Symptom org.xwiki.activeinstalls2.test.ui.ActiveInstallsIT#verifyActiveInstalls fails often on CI and failed every time locally. The test waits up to 30s for the ping sent by XWiki at startup to appear in the installs3 Elasticsearch index:
client.indices().refresh();
...
while (count != 1 && (System.currentTimeMillis() - time) < 30000L) {
count = client.count(b -> b.index("installs3")).count();
Thread.sleep(100L);
}
But count() throws when the index doesn't exist yet, i.e. when the ping hasn't been indexed yet, so the loop never retries:
On CI it also fails earlier, on the refresh() call, when Elasticsearch doesn't answer in time:
Occurrences (Environment Tests, stable-17.10.x)
It also fails on stable-18.4.x. The test code is the same on stable-17.10.x, stable-18.4.x, stable-18.8.x and master. Local reproduction Run 3 times locally on stable-17.10.x commit 87df7079518 with PostgreSQL / Tomcat 11-jdk25 / S3 / Chrome: 0/3 passed, each time with the index_not_found_exception on the first count() call. Fix direction Treat a missing installs3 index as "count = 0" and keep polling until the timeout, instead of failing on the first call. |