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:18:44 UTC
[tika] branch branch_1x 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 branch_1x
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/branch_1x by this push:
new 42676a6 improve logging and error reporting in TikaServerIntegrationTest
42676a6 is described below
commit 42676a6b2e73306458643603381c46743801a544
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