aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src
diff options
context:
space:
mode:
authorgjoranv <gv@oath.com>2018-09-06 12:19:13 +0200
committergjoranv <gv@oath.com>2018-09-06 13:00:52 +0200
commit9f7e5b86dd6f8b1598fc90078c846fbe3dc100c7 (patch)
tree0d98dd65dbe6b437cf8280ebd3126a99fdb7b8ec /controller-server/src
parentc1fdecf3cb26f1a3aef2caf290916a4f533c6c58 (diff)
Java 9: Truncate Instants from Instant.now() to MILLIS
- JDK 9 has higher resolution for Instant.now() than JDK 1.8, while instants deserialized from slime only has ms resolution.
Diffstat (limited to 'controller-server/src')
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializerTest.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializerTest.java
index 82aee3b3550..de9fe3f3dcc 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializerTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/persistence/RunSerializerTest.java
@@ -30,12 +30,13 @@ import static com.yahoo.vespa.hosted.controller.deployment.Step.deactivateTester
import static com.yahoo.vespa.hosted.controller.deployment.Step.deployInitialReal;
import static com.yahoo.vespa.hosted.controller.deployment.Step.deployReal;
import static com.yahoo.vespa.hosted.controller.deployment.Step.deployTester;
+import static com.yahoo.vespa.hosted.controller.deployment.Step.endTests;
import static com.yahoo.vespa.hosted.controller.deployment.Step.installInitialReal;
import static com.yahoo.vespa.hosted.controller.deployment.Step.installReal;
import static com.yahoo.vespa.hosted.controller.deployment.Step.installTester;
import static com.yahoo.vespa.hosted.controller.deployment.Step.report;
import static com.yahoo.vespa.hosted.controller.deployment.Step.startTests;
-import static com.yahoo.vespa.hosted.controller.deployment.Step.endTests;
+import static java.time.temporal.ChronoUnit.MILLIS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -97,7 +98,7 @@ public class RunSerializerTest {
.build(),
run.steps());
- run = run.aborted().finished(Instant.now());
+ run = run.aborted().finished(Instant.now().truncatedTo(MILLIS));
assertEquals(aborted, run.status());
assertTrue(run.hasEnded());