[
https://issues.apache.org/jira/browse/HADOOP-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758501#action_12758501
]
Nigel Daley commented on HADOOP-6276:
-------------------------------------
Nicholas, this was a common problem back when I was more involved in the
individual features and patches going into the release. I remember many times
that tests failed because of sleep() calls and Owen was constantly pushing on
committers to remove sleep calls and think more deeply about how to test a
feature. It doesn't take much imagination to realize that the amount of time
that a test sleeps is based on an assumption about the speed of the machine --
an assumption that can be wrong in some environments.
> 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.