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

Rakesh R commented on ZOOKEEPER-1852:
-------------------------------------

For more understanding about the scenario, I'm adding few more information. 
Please see it.

The case what I have observed in the build is, say one of the test case failed 
at "waiting for server up" as shown below. Now in this case 
'ClientBase.serverFactory' reference will not be initialized and teardown will 
not be able to shutdown this server. This will leave server running and 
affecting other test cases. Example log pattern has been taken from 
https://builds.apache.org/job/ZooKeeper-3.4-WinVS2008_java/390/

{code}
    [junit] 2013-12-25 09:08:00,837 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@62] - TEST METHOD FAILED 
testWatchAutoResetWithPending
    [junit] java.lang.AssertionError: waiting for server up
    [junit]     at org.junit.Assert.fail(Assert.java:91)
    [junit]     at org.junit.Assert.assertTrue(Assert.java:43)
    [junit]     at 
org.apache.zookeeper.test.ClientBase.createNewServerInstance(ClientBase.java:337)
    [junit]     at 
org.apache.zookeeper.test.ClientBase.startServer(ClientBase.java:414)
    [junit]     at 
org.apache.zookeeper.test.WatcherTest.testWatchAutoResetWithPending(WatcherTest.java:208)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
{code}

Following log showing the test case is failing by seeing unexpected beans which 
was left open in previous test case. 
{code}
    [junit] 2013-12-25 09:08:06,018 [myid:] - INFO  [main:JMXEnv@142] - 
unexpected:org.apache.ZooKeeperService:name0=StandaloneServer_port-1,name1=Connections,name2=127.0.0.1,name3=0x1432900e4090000
    [junit] 2013-12-25 09:08:06,018 [myid:] - INFO  [main:JMXEnv@142] - 
unexpected:org.apache.ZooKeeperService:name0=StandaloneServer_port-1,name1=InMemoryDataTree
    [junit] 2013-12-25 09:08:06,018 [myid:] - INFO  [main:JMXEnv@142] - 
unexpected:org.apache.ZooKeeperService:name0=StandaloneServer_port-1,name1=Connections,name2=127.0.0.1,name3=0x1432900e4090002
    [junit] 2013-12-25 09:08:06,018 [myid:] - INFO  [main:JMXEnv@142] - 
unexpected:org.apache.ZooKeeperService:name0=StandaloneServer_port-1
    [junit] 2013-12-25 09:08:06,018 [myid:] - INFO  [main:ZKTestCase$1@65] - 
FAILED testWatchAutoResetWithPending
    [junit] org.junit.internal.runners.model.MultipleFailureException
    [junit]     at 
org.junit.internal.runners.model.MultipleFailureException.assertEmpty(MultipleFailureException.java:23)
    [junit]     at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:42)
    [junit]     at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
    [junit]     at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
{code}


> ServerCnxnFactory instance is not properly cleanedup
> ----------------------------------------------------
>
>                 Key: ZOOKEEPER-1852
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1852
>             Project: ZooKeeper
>          Issue Type: Sub-task
>          Components: tests
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 3.4.6, 3.5.0
>
>         Attachments: ZOOKEEPER-1852-br-3.4.patch, 
> ZOOKEEPER-1852-br-3.4.patch, ZOOKEEPER-1852.patch, ZOOKEEPER-1852.patch
>
>
> ClientBase#createNewServerInstance() - Say the startup of the server fails, 
> this will not initialize 'serverFactory' and will be null. When the flow 
> comes to teardown/shutdown, it will bypass stopping of this server instance 
> due to the following check. This will affect other test case verifications 
> like, jmx check 'JMXEnv#ensureOnly'.  
> ClientBase#shutdownServerInstance
> {code}
>     static void shutdownServerInstance(ServerCnxnFactory factory,
>             String hostPort)
>     {
>         if (factory != null) {
>            //...shutdown logic
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to