Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25302

ActiveInstallsIT#verifyActiveInstalls is flickering

    XMLWordPrintable

Details

    • 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)

      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

          Activity

            People

              Unassigned Unassigned
              surli Simon Urli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: