You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2019/12/02 21:19:48 UTC

[tika] branch master updated: improve logging and error reporting in TikaServerIntegrationTest

This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ff613c  improve logging and error reporting in TikaServerIntegrationTest
3ff613c is described below

commit 3ff613cefde7356f5a4cd2491f7d11f828e59c0f
Author: tallison <ta...@apache.org>
AuthorDate: Mon Dec 2 16:18:12 2019 -0500

    improve logging and error reporting in TikaServerIntegrationTest
---
 .../apache/tika/server/TikaServerIntegrationTest.java   | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/tika-server/src/test/java/org/apache/tika/server/TikaServerIntegrationTest.java b/tika-server/src/test/java/org/apache/tika/server/TikaServerIntegrationTest.java
index e98ce8c..a91962b 100644
--- a/tika-server/src/test/java/org/apache/tika/server/TikaServerIntegrationTest.java
+++ b/tika-server/src/test/java/org/apache/tika/server/TikaServerIntegrationTest.java
@@ -423,27 +423,32 @@ public class TikaServerIntegrationTest extends TikaTest {
     }
 
     private void awaitServerStartup() throws Exception {
-
+        long maxWaitMs = 30000;
         Instant started = Instant.now();
         long elapsed = Duration.between(started, Instant.now()).toMillis();
         WebClient client = WebClient.create(endPoint+"/tika").accept("text/plain");
-        while (elapsed < 30000) {
+        while (elapsed < maxWaitMs) {
             try {
                 Response response = client.get();
                 if (response.getStatus() == 200) {
-                    return;
+                    Thread.sleep(100);
+                    response = client.get();
+                    if (response.getStatus() == 200) {
+                        LOG.info("client observes that server successfully started");
+                        return;
+                    }
                 }
-                LOG.info("tika test client failed to connect to server with status: {}", response.getStatus());
+                LOG.debug("tika test client failed to connect to server with status: {}", response.getStatus());
 
             } catch (javax.ws.rs.ProcessingException e) {
-                LOG.info("tika test client failed to connect to server: {}", e.getMessage());
                 LOG.debug("tika test client failed to connect to server", e);
             }
 
             Thread.sleep(100);
             elapsed = Duration.between(started, Instant.now()).toMillis();
         }
-
+        throw new IllegalStateException("couldn't connect to server after " +
+                maxWaitMs + " ms");
     }
 
     @Test