This is an automated email from the ASF dual-hosted git repository. bdelacretaz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git
commit 5aaca3c30190458509d833909c91555263aa1cd1 Author: Bertrand Delacretaz <[email protected]> AuthorDate: Mon Jun 15 15:50:18 2020 +0200 Don't be an old fart --- .../org/apache/sling/graphql/core/it/GraphQLCoreTestSupport.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/sling/graphql/core/it/GraphQLCoreTestSupport.java b/src/test/java/org/apache/sling/graphql/core/it/GraphQLCoreTestSupport.java index e2a2a0b..078c5c6 100644 --- a/src/test/java/org/apache/sling/graphql/core/it/GraphQLCoreTestSupport.java +++ b/src/test/java/org/apache/sling/graphql/core/it/GraphQLCoreTestSupport.java @@ -54,6 +54,8 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration; import java.io.Reader; import java.io.StringReader; +import java.time.Duration; +import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -141,9 +143,9 @@ public abstract class GraphQLCoreTestSupport extends TestSupport { final int expectedStatus = 200; final List<Integer> statuses = new ArrayList<>(); final String path = "/.json"; - final long endTime = System.currentTimeMillis() + STARTUP_WAIT_SECONDS * 1000; + final Instant endTime = Instant.now().plus(Duration.ofSeconds(STARTUP_WAIT_SECONDS)); - while (System.currentTimeMillis() < endTime) { + while(Instant.now().isBefore(endTime)) { final int status = executeRequest("GET", path, null, null, null, -1).getStatus(); statuses.add(status); if (status == expectedStatus) {
