hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Douglas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-6276) test-patch script should -1 patches that increase the number of Thread.sleep() calls in tests
Date Tue, 22 Sep 2009 20:26:18 GMT

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

Chris Douglas commented on HADOOP-6276:
---------------------------------------

The intent is to avoid writing tests with race conditions affecting success. A \-1 from test-patch
requires that one demonstrate that the sleep duration is orthogonal to the outcome, e.g. that
the slow writer is simply slow, and the test is measuring the system's response to it. While
writing flaky tests doesn't require Thread.sleep, it's a lot easier with it. Polling should
be OK where we don't offer callbacks.

> test-patch script should -1 patches that increase the number of Thread.sleep() calls
in tests
> ---------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-6276
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6276
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: test
>            Reporter: Nigel Daley
>            Assignee: Giridharan Kesavan
>
> Calls to Thread.sleep() in tests are likely dubious.  There are rare occasions where
these are required, but in general they lead to flaky unit tests that fail sporadically. 
We used to be much better at code reviewing these out of patches, but have lost ground on
that in the last few years (and our flaky unit tests show that!). 
> I propose we have the test-patch script ensure that a patch does not add to the number
of Thread.sleep() calls in *tests* by giving a -1 to patches that do increase it.  I suggest
this is a simple grep for lines containing "Thread.sleep(" and a "+" character in the first
column.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message