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

Germán Blanco commented on ZOOKEEPER-1837:
------------------------------------------

If the condition (nTry < 50) is false, then the loop ends. So nTry will never 
be above 50.
The border case is that nTry reaches 50 and by chance in that last run through 
the loop there is no unexpected beans found. But that case works just as any 
other value below 50, it means JMX manage to synchronized to the expected state 
after 5 seconds and no failure needs to be reported.

> Fix JMXEnv checks (potential race conditions)
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-1837
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1837
>             Project: ZooKeeper
>          Issue Type: Sub-task
>          Components: tests
>    Affects Versions: 3.4.5, 3.5.0
>         Environment: Windows 8
>            Reporter: Germán Blanco
>            Assignee: Germán Blanco
>             Fix For: 3.4.6, 3.5.0
>
>         Attachments: ZOOKEEPER-1837-b3.4.patch, ZOOKEEPER-1837-b3.4.patch, 
> ZOOKEEPER-1837-b3.4.patch, ZOOKEEPER-1837-b3.4.patch, ZOOKEEPER-1837.patch, 
> ZOOKEEPER-1837.patch, ZOOKEEPER-1837.patch, ZOOKEEPER-1837.patch, 
> ZOOKEEPER-1837.patch, ZOOKEEPER-1837.patch
>
>
> The following failures in ZooKeeper-3.4-WinVS2008_java and 
> ZooKeeper-trunk-WinVS2008_java require fixing:
> [junit] junit.framework.AssertionFailedError: expected:<0> but was:<1>
>     [junit]   at junit.framework.Assert.fail(Assert.java:47)
>     [junit]   at junit.framework.Assert.failNotEquals(Assert.java:283)
>     [junit]   at junit.framework.Assert.assertEquals(Assert.java:64)
>     [junit]   at junit.framework.Assert.assertEquals(Assert.java:195)
>     [junit]   at junit.framework.Assert.assertEquals(Assert.java:201)
>     [junit]   at org.apache.zookeeper.test.JMXEnv.ensureOnly(JMXEnv.java:138)
>     [junit]   at 
> org.apache.zookeeper.test.ClientBase.startServer(ClientBase.java:417)
>     [junit]   at 
> org.apache.zookeeper.test.ZooKeeperQuotaTest.testQuota(ZooKeeperQuotaTest.java:80)
>     [junit]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     [junit]   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     [junit]   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     [junit]   at java.lang.reflect.Method.invoke(Method.java:597)
>     [junit]   at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>     [junit]   at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>     [junit]   at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>     [junit]   at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> [junit] junit.framework.AssertionFailedError: expected:<0> but was:<1>
>     [junit]   at junit.framework.Assert.fail(Assert.java:47)
>     [junit]   at junit.framework.Assert.failNotEquals(Assert.java:283)
>     [junit]   at junit.framework.Assert.assertEquals(Assert.java:64)
>     [junit]   at junit.framework.Assert.assertEquals(Assert.java:195)
>     [junit]   at junit.framework.Assert.assertEquals(Assert.java:201)
>     [junit]   at org.apache.zookeeper.test.JMXEnv.ensureOnly(JMXEnv.java:138)
>     [junit]   at 
> org.apache.zookeeper.test.ClientBase.startServer(ClientBase.java:417)
>     [junit]   at 
> org.apache.zookeeper.test.ZooKeeperQuotaTest.testQuota(ZooKeeperQuotaTest.java:80)
>     [junit]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     [junit]   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     [junit]   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     [junit]   at java.lang.reflect.Method.invoke(Method.java:597)
>     [junit]   at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>     [junit]   at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>     [junit]   at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>     [junit]   at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>     [junit]   at 
> org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:52)
>     [
> junit.framework.AssertionFailedError: expected [0x142e5f027b50001] 
> expected:<1> but was:<0>
>       at org.apache.zookeeper.test.JMXEnv.ensureAll(JMXEnv.java:115)
>       at 
> org.apache.zookeeper.test.ClientBase.createClient(ClientBase.java:197)
>       at 
> org.apache.zookeeper.test.ClientBase.createClient(ClientBase.java:171)
>       at 
> org.apache.zookeeper.test.ClientBase.createClient(ClientBase.java:156)
>       at 
> org.apache.zookeeper.test.ClientBase.createClient(ClientBase.java:149)
>       at 
> org.apache.zookeeper.ZooKeeperTest.testDeleteRecursive(ZooKeeperTest.java:45)
>       at 
> org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:52)



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

Reply via email to