You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Sijie Guo (JIRA)" <ji...@apache.org> on 2012/07/26 09:00:46 UTC

[jira] [Created] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Sijie Guo created BOOKKEEPER-352:
------------------------------------

             Summary: Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
                 Key: BOOKKEEPER-352
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
             Project: Bookkeeper
          Issue Type: Bug
            Reporter: Sijie Guo
            Assignee: Sijie Guo


TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.

Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423896#comment-13423896 ] 

Hudson commented on BOOKKEEPER-352:
-----------------------------------

Integrated in bookkeeper-trunk #622 (See [https://builds.apache.org/job/bookkeeper-trunk/622/])
    BOOKKEEPER-352: Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats (sijie via fpj) (Revision 1366384)

     Result = SUCCESS
fpj : 
Files : 
* /zookeeper/bookkeeper/trunk/CHANGES.txt
* /zookeeper/bookkeeper/trunk/bookkeeper-server/src/test/java/org/apache/bookkeeper/proto/TestBKStats.java
* /zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/netty/TestServerStats.java

                
> Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-352
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-352.diff
>
>
> TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.
> Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Flavio Junqueira updated BOOKKEEPER-352:
----------------------------------------

    Fix Version/s: 4.1.1
    
> Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-352
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0, 4.1.1
>
>         Attachments: BOOKKEEPER-352.diff
>
>
> TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.
> Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423916#comment-13423916 ] 

Flavio Junqueira commented on BOOKKEEPER-352:
---------------------------------------------

Branch 4.1 commit. CommitCommitted revision 1366409.
                
> Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-352
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0, 4.1.1
>
>         Attachments: BOOKKEEPER-352.diff
>
>
> TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.
> Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13424717#comment-13424717 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-352:
------------------------------------------------

Oh, Thanks Sijie for the patch. I couldn't take a look (I was on leave). 
Also I should have run the suit once. Since the changes are pretty straight forward and had full confidence that tests will pass.
I remember surefire will fork separate JVM for each test. no?
                
> Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-352
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0, 4.1.1
>
>         Attachments: BOOKKEEPER-352.diff
>
>
> TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.
> Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Posted by "Flavio Junqueira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423250#comment-13423250 ] 

Flavio Junqueira commented on BOOKKEEPER-352:
---------------------------------------------

Hi Sijie, The patch is indeed simple. With these modifications, getInstance() in BKStats and ServerStats are still used, right? 
                
> Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-352
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0, 4.1.1
>
>         Attachments: BOOKKEEPER-352.diff
>
>
> TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.
> Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-352:
---------------------------------

    Affects Version/s: 4.2.0
        Fix Version/s: 4.1.1
                       4.2.0
    
> Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-352
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0, 4.1.1
>
>
> TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.
> Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BOOKKEEPER-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423584#comment-13423584 ] 

Sijie Guo commented on BOOKKEEPER-352:
--------------------------------------

the modifications just fixed test cases. getInstance() are still used for a server to collect statistics.
                
> Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-352
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0, 4.1.1
>
>         Attachments: BOOKKEEPER-352.diff
>
>
> TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.
> Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (BOOKKEEPER-352) Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats

Posted by "Sijie Guo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BOOKKEEPER-352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-352:
---------------------------------

    Attachment: BOOKKEEPER-352.diff

attach a patch to fix it. the fix is quite simple, just new an OpStats instead of using OpStats from a static instance.
                
> Should not use static ServerStats/BKStats instance in TestServerStats/TestBKStats
> ---------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-352
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-352
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0, 4.1.1
>
>         Attachments: BOOKKEEPER-352.diff
>
>
> TestServers failed when running whole test. Because TestServers uses ServerStats instance directly. ServerStats is a static instance, which will be used across whole testing. so the numSuccessOps would not be zero, the assertion would fail.
> Same problem occurs in TestBKStats. TestBKStats doesn't fail because statistics is turned off by default. The value happened to be zero. But it still is not a good idea to use static instance during testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira