Steve Loughran updated HADOOP-13716:
    Attachment: HADOOP-13716-003.patch

HADOOP-13716 patch 003:
* expanded goal of being set of lambda expressions, rather than just 
eventually() & evaluate()
* added intercept() to intercept exceptions, optionally look for text. Self 
* renamed to LambdaTestUtils to emphasise role and scope
* best effort at addressing codestyle warnings; IDE may still be getting 
indentation wrong.

Again, designed to work with Java 7 alongside java 8, just works better when 
you can do closures without writing anonymous inner classes

> Add LambdaTestUtils class for tests to make use of
> --------------------------------------------------
>                 Key: HADOOP-13716
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13716
>             Project: Hadoop Common
>          Issue Type: New Feature
>          Components: test
>    Affects Versions: 2.8.0
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>         Attachments: HADOOP-13716-001.patch, HADOOP-13716-002.patch, 
> HADOOP-13716-003.patch
> To make our tests robust against timing problems and eventual consistent 
> stores, we need to do more spin & wait for state.
> We have some code in {{GenericTestUtils.waitFor}} to await a condition being 
> met, but the predicate it calls doesn't throw exceptions, there's no way for 
> a probe to throw an exception, and all you get is the eventual "timed out" 
> message. 
> We can do better, and in closure-ready languages (scala & scalatest, groovy 
> and some slider code) we've examples to follow. Some of that work has been 
> reimplemented slightly in {{S3ATestUtils.eventually}}
> I propose adding a class in the test tree, {{Eventually}} to be a 
> successor/replacement for these.
> # has an eventually/waitfor operation taking a predicate that throws an 
> exception
> # has an "evaluate" exception which tries to evaluate an answer until the 
> operation stops raising an exception. (again, from scalatest)
> # plugin backoff strategies (from Scalatest; lets you do exponential as well 
> as linear)
> # option of adding a special handler to generate the failure exception (e.g. 
> run more detailed diagnostics for the exception text, etc).
> # be Java 8 lambda expression friendly
> # be testable and tested itself.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to