Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
17.10.13
-
Unknown
-
-
org.xwiki.activeinstalls2.test.ui.AllIT$NestedActiveInstallsIT#verifyActiveInstalls
Description
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:
co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/count] failed: [index_not_found_exception] no such index [installs3] at co.elastic.clients.elasticsearch.ElasticsearchClient.count(ElasticsearchClient.java:509) at org.xwiki.activeinstalls2.test.ui.ActiveInstallsIT.verifyActiveInstalls(ActiveInstallsIT.java:75)
On CI it also fails earlier, on the refresh() call, when Elasticsearch doesn't answer in time:
java.net.SocketTimeoutException: 30,000 milliseconds timeout on connection http-outgoing-0 [ACTIVE] at org.elasticsearch.client.RestClient.performRequest(RestClient.java:304) at org.xwiki.activeinstalls2.test.ui.ActiveInstallsIT.verifyActiveInstalls(ActiveInstallsIT.java:70)
Occurrences (Environment Tests, stable-17.10.x)
- https://ci.xwiki.org/job/XWiki%20Environment%20Tests/job/xwiki-platform/job/stable-17.10.x/320/ - PostgreSQL / Tomcat 11-jdk25 / S3 / Chrome
- https://ci.xwiki.org/job/XWiki%20Environment%20Tests/job/xwiki-platform/job/stable-17.10.x/319/ - MariaDB / Jetty 12-jdk25 / S3 / Firefox and Oracle / Jetty 12-jdk25 / Filesystem / Firefox
- https://ci.xwiki.org/job/XWiki%20Environment%20Tests/job/xwiki-platform/job/stable-17.10.x/318/ - Oracle / Jetty 12-jdk25 / Filesystem / Firefox
- https://ci.xwiki.org/job/XWiki%20Environment%20Tests/job/xwiki-platform/job/stable-17.10.x/317/ - MySQL / Tomcat 11-jdk25 / Filesystem / Chrome
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.
Attachments
Issue Links
- relates to
-
XWIKI-18540 ActiveInstallsIT#verifyActiveInstalls is flickering
-
- Closed
-