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

ASF GitHub Bot commented on CURATOR-493:
----------------------------------------

Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/curator/pull/291#discussion_r240039803
  
    --- Diff: 
curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
 ---
    @@ -686,35 +693,66 @@ public void run()
                             }
                             else
                             {
    -                            Assert.fail("unknown exception", e);
    +                            Assert.fail("unexpected exception", e);
                             }
                         }
                         finally
                         {
    -                        countDownLatch.countDown();
    +                        log.info("client has deleted children, it costs: 
{}ms", System.currentTimeMillis() - start);
    +                        latch.countDown();
                         }
                     }
                 }).start();
     
    -            Thread.sleep(20L);
    -            try
    -            {
    -                client2.delete().forPath("/parent/child" + (childCount / 
2));
    -            }
    -            catch ( Exception e )
    +            boolean threadDeleted = false;
    +            boolean client2Deleted = false;
    +            Random random = new Random();
    +            for ( int i = 0; i < childCount; i++ )
                 {
    -                if ( e instanceof KeeperException.NoNodeException )
    +                String child = "/parent/child" + 
random.nextInt(childCount);
    +                try
                     {
    -                    Assert.fail("client2 delete failed, shouldn't throw 
NoNodeException", e);
    +                    if ( !threadDeleted )
    +                    {
    +                        Stat stat = client2.checkExists().forPath(child);
    +                        if ( stat == null )
    +                        {
    +                            // the thread client has begin deleted the 
children
    +                            threadDeleted = true;
    --- End diff --
    
    What's the point of this? Once it is set, checkExists() is never called 
again. That seems incorrect. I removed this and the test still passes. Can you 
explain?


> Fix test case with testDeleteChildrenConcurrently
> -------------------------------------------------
>
>                 Key: CURATOR-493
>                 URL: https://issues.apache.org/jira/browse/CURATOR-493
>             Project: Apache Curator
>          Issue Type: Test
>          Components: Framework
>            Reporter: hebelala
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to