You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Li Wang (Jira)" <ji...@apache.org> on 2022/11/09 02:40:00 UTC

[jira] [Commented] (ZOOKEEPER-4632) Fix NPE from ConnectionMetricsTest.testRevalidateCount

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

Li Wang commented on ZOOKEEPER-4632:
------------------------------------

The test failure ConnectionMetricsTest.testRevalidateCount is related to the changes in this PR.

int follower1 = (int) util.getFollowerQuorumPeers().get(0).getId()

The test calls getId() to get the server id. Since getId() was changed to getMyId(), the super class Thread.getId() is called and the thread id was returned. There is no corresponding peer associated to the thread id, that's why NPE is thrown.  

The fix is changing getId() to getMyId().

https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/test/java/org/apache/zookeeper/server/ConnectionMetricsTest.java#L60-L65

> Fix NPE from ConnectionMetricsTest.testRevalidateCount
> ------------------------------------------------------
>
>                 Key: ZOOKEEPER-4632
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4632
>             Project: ZooKeeper
>          Issue Type: Task
>          Components: tests
>            Reporter: Li Wang
>            Assignee: Li Wang
>            Priority: Major
>
> PRB is currently broken as ConnectionMetricsTest.testRevalidateCount() throws NPE.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)