Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6EA9D200BA8 for ; Mon, 24 Oct 2016 14:22:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6D2BC160B00; Mon, 24 Oct 2016 12:22:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B722A160AE1 for ; Mon, 24 Oct 2016 14:22:04 +0200 (CEST) Received: (qmail 81963 invoked by uid 500); 24 Oct 2016 12:21:58 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 81943 invoked by uid 99); 24 Oct 2016 12:21:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2016 12:21:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9882F2C1F56 for ; Mon, 24 Oct 2016 12:21:58 +0000 (UTC) Date: Mon, 24 Oct 2016 12:21:58 +0000 (UTC) From: "Steve Loughran (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-13716) Add LambdaTestUtils class for tests; fix eventual consistency problem in contract test setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 24 Oct 2016 12:22:05 -0000 [ https://issues.apache.org/jira/browse/HADOOP-13716?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Steve Loughran updated HADOOP-13716: ------------------------------------ Status: Patch Available (was: Reopened) > Add LambdaTestUtils class for tests; fix eventual consistency problem in contract test setup > -------------------------------------------------------------------------------------------- > > 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 > Fix For: 2.8.0, 3.0.0-alpha2 > > Attachments: HADOOP-13716-001.patch, HADOOP-13716-002.patch, HADOOP-13716-003.patch, HADOOP-13716-005.patch, HADOOP-13716-006.patch, HADOOP-13716-branch-2-004.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 (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org