[ 
https://issues.apache.org/jira/browse/HADOOP-14851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16159174#comment-16159174
 ] 

Steve Loughran commented on HADOOP-14851:
-----------------------------------------

Test failure seems impossible to associate with this code, as the test which 
fails doesn't use the edited code. And it works locally.

{code}
java.lang.AssertionError: null
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertTrue(Assert.java:52)
        at 
org.apache.hadoop.metrics2.sink.TestFileSink.testFileSink(TestFileSink.java:135)
{code}

checkstyle complaints are about layout of lambda-expressions; wrapping the 
calls up to keep it lean and readable  without checkstyle overreacting



> LambdaTestUtils.eventually() doesn't spin on Assertion failures
> ---------------------------------------------------------------
>
>                 Key: HADOOP-14851
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14851
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 2.8.1
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>         Attachments: HADOOP-14851-001.patch
>
>
> This is funny. The {{LsmbdaTestUtils.eventually()}} method, meant to spin 
> until a closure stops raising exceptions, doesn't catch {{Error}} and 
> subclasses, so doesn't fail on an {{Assert.assert()}} failure, which raises 
> an {{AssertionError}}. My bad :)
> Example:
> {code}
>     eventually(TIMEOUT,
>         () -> {
>           while (counter.incrementAndGet()  < 5) {
>             assert false : "oops";
>           }
>         },
>         retryLogic);
> {code}
> Fix: catch Throwable, rethrow. Needs to add VirtualMachineError & subclasses 
> to the set of errors not to spin on (OOM, stack overflow, ...)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to