summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-09-30 17:42:03 +0200
committerJon Marius Venstad <venstad@gmail.com>2020-09-30 17:42:03 +0200
commitdc4f51621c0c965f97459c8c7f19aa3062d41567 (patch)
treea59d79e187e1cc459ccf72c2d72a13dbfa43a148 /vespaclient-container-plugin
parentc068007feadd8c3f8332c7e80db9ad6e2e2a8093 (diff)
Make ManualClock thread safe
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java
index 6a10d38d0b7..ea34091879b 100644
--- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/DocumentOperationExecutorTest.java
@@ -203,15 +203,15 @@ public class DocumentOperationExecutorTest {
clock.advance(Duration.ofMillis(20));
executor.put(new DocumentPut(doc2), parameters(), operationContext());
executor.notifyMaintainers();
- assertEquals(List.of(), received);
assertEquals(List.of(), errors);
+ assertEquals(List.of(), received);
clock.advance(Duration.ofMillis(990));
executor.notifyMaintainers(); // Let doc1 time out.
phaser.arrive(); // Let doc2 arrive.
- phaser.arriveAndAwaitAdvance(); // Wait for responses to be delivered. <3 Phaser <3
- assertEquals(List.of(doc2), received);
+ phaser.arriveAndAwaitAdvance(); // Wait for responses to be delivered.
assertEquals(List.of(TIMEOUT), errors);
+ assertEquals(List.of(doc2), received);
session().setResultType(Result.ResultType.TRANSIENT_ERROR);
executor.put(new DocumentPut(doc3), parameters(), operationContext());
@@ -219,16 +219,16 @@ public class DocumentOperationExecutorTest {
executor.notifyMaintainers(); // Retry throttled operation.
clock.advance(Duration.ofMillis(20));
executor.notifyMaintainers(); // Time out throttled operation.
- assertEquals(List.of(doc2), received);
assertEquals(List.of(TIMEOUT, TIMEOUT), errors);
+ assertEquals(List.of(doc2), received);
session().setResultType(Result.ResultType.SUCCESS);
clock.advance(Duration.ofMillis(20));
executor.notifyMaintainers(); // Retry not attempted since operation already timed out.
phaser.arrive();
phaser.arriveAndAwaitAdvance();
- assertEquals(List.of(doc2), received);
assertEquals(List.of(TIMEOUT, TIMEOUT), errors);
+ assertEquals(List.of(doc2), received);
}
@Test