From 5e944dc9303aa396b182b4f2ca5f7fc09693516f Mon Sep 17 00:00:00 2001 From: William Burns Date: Thu, 28 Feb 2019 14:32:07 -0500 Subject: [PATCH] Adding in delay in case if first assertion fails Also removed no longer needed README --- integration-tests/infinispan-client/README.md | 35 ------------------- .../example/infinispanclient/TestServlet.java | 17 ++++++--- .../InfinispanClientFunctionalityTest.java | 1 - 3 files changed, 13 insertions(+), 40 deletions(-) delete mode 100644 integration-tests/infinispan-client/README.md diff --git a/integration-tests/infinispan-client/README.md b/integration-tests/infinispan-client/README.md deleted file mode 100644 index 9169520470d41..0000000000000 --- a/integration-tests/infinispan-client/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Infinispan client example - -## Running the tests - -By default, the tests of this module are disabled. - -To run the tests in a standard JVM with Infinispan Server started as a Docker container, you can run the following command: - -``` -mvn clean install -Dtest-infinispan-client -Ddocker -``` - -Additionally, you can generate a native image and run the tests for this native image by adding `-Dnative`: - -``` -mvn clean install -Dtest-infinispan-client -Ddocker -Dnative -``` - -If you don't want to run Infinispan Server as a Docker container, you can start your own Infinispan Server. It needs to listen on the 11232 port and have a cache named `default` accessible. - -You can then run the tests as follows (either with `-Dnative` or not): - -``` -mvn clean install -Dtest-infinispan-client -``` - -Note that the native tests will currently fail due to a TimeoutException that is fixed with a 10.0.0-Beta1 server or newer. This is a bug in the server itself only. - -## Enabling logging for server in docker - -You can log the output from the docker container running the Infinispan Server by specifying `-Ddocker.showLogs` to command line. - -``` -mvn clean install -Dtest-infinispan-client -Ddocker -Ddocker.showLogs -``` diff --git a/integration-tests/infinispan-client/src/main/java/io/quarkus/example/infinispanclient/TestServlet.java b/integration-tests/infinispan-client/src/main/java/io/quarkus/example/infinispanclient/TestServlet.java index c73c629a0d1f4..f51a1ffc7d523 100644 --- a/integration-tests/infinispan-client/src/main/java/io/quarkus/example/infinispanclient/TestServlet.java +++ b/integration-tests/infinispan-client/src/main/java/io/quarkus/example/infinispanclient/TestServlet.java @@ -265,7 +265,7 @@ public String nearCache() { long misses = stats.getNearCacheMisses(); if (nearCacheMisses + 1 != misses) { - return "Near cache didn't miss for some reason. Expected: " + nearCacheMisses + 1 + " but got: " + misses; + return "Near cache didn't miss for some reason. Expected: " + (nearCacheMisses + 1) + " but got: " + misses; } if (!retrievedBook.equals(nearCacheBook)) { @@ -280,7 +280,7 @@ public String nearCache() { long hits = stats.getNearCacheHits(); if (nearCacheHits + 1 != hits) { - return "Near cache didn't hit for some reason. Expected: " + nearCacheHits + 1 + " but got: " + hits; + return "Near cache didn't hit for some reason. Expected: " + (nearCacheHits + 1) + " but got: " + hits; } if (!retrievedBook.equals(nearCacheBook)) { @@ -293,8 +293,17 @@ public String nearCache() { long invalidations = stats.getNearCacheInvalidations(); if (nearCacheInvalidations + 1 != invalidations) { - return "Near cache didn't invalidate for some reason. Expected: " + nearCacheInvalidations + 1 + " but got: " - + invalidations; + // Try a second time after waiting just a little bit + try { + Thread.sleep(100); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + invalidations = stats.getNearCacheInvalidations(); + if (nearCacheInvalidations + 1 != invalidations) { + return "Near cache didn't invalidate for some reason. Expected: " + (nearCacheInvalidations + 1) + " but got: " + + invalidations; + } } cache.remove(id); diff --git a/integration-tests/infinispan-client/src/test/java/io/quarkus/example/test/InfinispanClientFunctionalityTest.java b/integration-tests/infinispan-client/src/test/java/io/quarkus/example/test/InfinispanClientFunctionalityTest.java index 6507915241984..7e70722bae888 100644 --- a/integration-tests/infinispan-client/src/test/java/io/quarkus/example/test/InfinispanClientFunctionalityTest.java +++ b/integration-tests/infinispan-client/src/test/java/io/quarkus/example/test/InfinispanClientFunctionalityTest.java @@ -15,7 +15,6 @@ */ @QuarkusTest @QuarkusTestResource(InfinispanServerTestResource.class) -@Disabled("Intermittently failing") public class InfinispanClientFunctionalityTest { @Test