[
https://issues.apache.org/jira/browse/HADOOP-12715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15112414#comment-15112414
]
Walter Su commented on HADOOP-12715:
------------------------------------
I got the same AssertionError if I delay the sync filling of {{getAtMost(19)}}
manually. You're correct, thanks [~xiaochen].
{code}
148 // Drain completely
149 Assert.assertEquals("Failed to drain completely.", 10,
150 vq.getAtMost("k1", 10).size());
151 // Synchronous call
152 Assert.assertEquals("Failed in sync call.", 10, filler.getTop().num);
153 // Ask for more... return all
154 GenericTestUtils.waitFor(new Supplier<Boolean>() {
...
169 }, 100, 3000);
170 Assert.assertEquals("Failed in async call.", 10, filler.getTop().num);
171 // Drain completely after filled by the async thread
172 Assert.assertEquals("Failed to drain completely after async.", 10,
173 vq.getAtMost("k1", 10).size());
{code}
Your comment at line 171 is good. The original comment at line 148 is
misleading. When test procedure goes to line 149, the queue in {{LoadingCache}}
is already empty.
So what line 148~150 does is "trigger sync task to fill returned list, and
another async task to fill the queue in the cache".
+1 once addressed.
> TestValueQueue#testgetAtMostPolicyALL fails intermittently
> ----------------------------------------------------------
>
> Key: HADOOP-12715
> URL: https://issues.apache.org/jira/browse/HADOOP-12715
> Project: Hadoop Common
> Issue Type: Test
> Reporter: Xiao Chen
> Assignee: Xiao Chen
> Attachments: HADOOP-12715.01.patch, HADOOP-12715.02.patch
>
>
> The test fails intermittently with the following error.
> Error Message
> {noformat}
> expected:<19> but was:<10>
> {noformat}
> Stacktrace
> {noformat}
> java.lang.AssertionError: expected:<19> but was:<10>
> at org.junit.Assert.fail(Assert.java:88)
> at org.junit.Assert.failNotEquals(Assert.java:743)
> at org.junit.Assert.assertEquals(Assert.java:118)
> at org.junit.Assert.assertEquals(Assert.java:555)
> at org.junit.Assert.assertEquals(Assert.java:542)
> at
> org.apache.hadoop.crypto.key.TestValueQueue.testgetAtMostPolicyALL(TestValueQueue.java:149)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)