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

Peter Bacsko commented on OOZIE-2584:
-------------------------------------

I think you mean testTimeoutTimingOutWriteLock.

No, I don't think it can cause problems: 
- L2 will time out for sure, because L1 holds the lock at that point 
(guaranteed)
- We call proceed(), L2 will continue terminating in the else branch
- We call awaitTermination() so we wait until L2 finishes

> Eliminate Thread.sleep() calls in TestMemoryLocks
> -------------------------------------------------
>
>                 Key: OOZIE-2584
>                 URL: https://issues.apache.org/jira/browse/OOZIE-2584
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Minor
>         Attachments: OOZIE-2584-001.patch
>
>
> There are a lot of Thread.sleep() calls in TestMemoryLocks.
> For example:
> {code}
>         new Thread(l1).start();
>         Thread.sleep(500);
>         new Thread(l2).start();
>         Thread.sleep(500);
> {code}
> This solution is very fragile. On a slower build machine, Thread2 might 
> actually start earlier than Thread1, causing test failure.
> Eliminate sleeps and use a more stable approach for start/stop coordination 
> (possibly CountDownLatches).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to