xkrogen commented on a change in pull request #1463: HADOOP-16581. Revise
ValueQueue to correctly replenish queues that go…
URL: https://github.com/apache/hadoop/pull/1463#discussion_r325779945
##########
File path:
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/key/TestValueQueue.java
##########
@@ -106,14 +122,15 @@ public void testWarmUp() throws Exception {
public void testRefill() throws Exception {
MockFiller filler = new MockFiller();
ValueQueue<String> vq =
- new ValueQueue<String>(10, 0.1f, 300, 1,
+ new ValueQueue<String>(100, 0.1f, 30000, 1,
SyncGenerationPolicy.ALL, filler);
+ // Trigger a prefill (10) and an async refill (91)
Assert.assertEquals("test", vq.getNext("k1"));
- Assert.assertEquals(1, filler.getTop().num);
- // Trigger refill
- vq.getNext("k1");
- Assert.assertEquals(1, filler.getTop().num);
Assert.assertEquals(10, filler.getTop().num);
+
+ // Wait for the async task to finish
+ waitForRefill(vq, "k1", 100);
+ Assert.assertEquals(91, filler.getTop().num);
Review comment:
Can you explain in a comment where the number 91 comes from? If I understand
correctly it's because the async replication task has to fill 91 values (`= 100
- 9`)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]