diff options
author | Harald Musum <musum@verizonmedia.com> | 2022-08-12 21:27:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 21:27:05 +0200 |
commit | 44b750efdb83be18d839ffc5495c4e02b87e0b0e (patch) | |
tree | 57ed2ba63feecb095844b9bc89c889d47b2faad8 /jrt/tests/com/yahoo/jrt/DetachTest.java | |
parent | 43830a7f7975080dbc4c25804a2506ab102c7868 (diff) | |
parent | ec64add133a3b25900fd25a266a2497e757f809e (diff) |
Merge pull request #23647 from vespa-engine/balder/use-duration-as-timeout
Add method to use Duration as timeout to make unit explicit, and avoi…
Diffstat (limited to 'jrt/tests/com/yahoo/jrt/DetachTest.java')
-rw-r--r-- | jrt/tests/com/yahoo/jrt/DetachTest.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/jrt/tests/com/yahoo/jrt/DetachTest.java b/jrt/tests/com/yahoo/jrt/DetachTest.java index 3c3356b53e2..4c3ee085913 100644 --- a/jrt/tests/com/yahoo/jrt/DetachTest.java +++ b/jrt/tests/com/yahoo/jrt/DetachTest.java @@ -4,6 +4,8 @@ package com.yahoo.jrt; import org.junit.After; import org.junit.Before; +import java.time.Duration; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -66,11 +68,11 @@ public class DetachTest { Test.Waiter w1 = new Test.Waiter(); Request req1 = new Request("d_inc"); req1.parameters().add(new Int32Value(50)); - target.invokeAsync(req1, 5.0, w1); + target.invokeAsync(req1, Duration.ofSeconds(5), w1); Request req2 = new Request("d_inc_r"); req2.parameters().add(new Int32Value(60)); - target.invokeSync(req2, 5.0); + target.invokeSync(req2, Duration.ofSeconds(5)); assertTrue(!req2.isError()); assertEquals(1, req2.returnValues().size()); @@ -123,7 +125,7 @@ public class DetachTest { Test.Waiter w = new Test.Waiter(); Request req3 = new Request("inc_b"); req3.parameters().add(new Int32Value(100)); - target.invokeAsync(req3, 5.0, w); + target.invokeAsync(req3, Duration.ofSeconds(5), w); Request blocked = (Request) receptor.get(); try { blocked.returnRequest(); |