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

Jason Lowe commented on HADOOP-10980:
-------------------------------------

Thanks for the patch, Eric!

My main concern of using port 22 is that we're essentially testing a use-case 
that should _never_ occur in practice.  We're testing what the ZK client will 
do when we try to connect it to sshd, but that's not something we expect users 
will ever do.  If the purpose of this test is to make sure that a ZK exception 
is not accidentally swallowed by the ActiveStandbyElector logic then we can 
mock the zkClient in the elector to throw a ZK exception when we try to 
connect.  Then we're guaranteed to get the base ZK exception we're looking for 
without relying on ports being unused which is difficult to enforce in practice.

> TestActiveStandbyElector fails occasionally in trunk
> ----------------------------------------------------
>
>                 Key: HADOOP-10980
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10980
>             Project: Hadoop Common
>          Issue Type: Test
>    Affects Versions: 3.0.0-alpha1
>            Reporter: Ted Yu
>            Assignee: Eric Badger
>            Priority: Minor
>         Attachments: HADOOP-10980.001.patch
>
>
> From https://builds.apache.org/job/Hadoop-Common-trunk/1211/consoleFull :
> {code}
> Running org.apache.hadoop.ha.TestActiveStandbyElector
> Tests run: 23, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.7 sec <<< 
> FAILURE! - in org.apache.hadoop.ha.TestActiveStandbyElector
> testWithoutZKServer(org.apache.hadoop.ha.TestActiveStandbyElector)  Time 
> elapsed: 0.051 sec  <<< FAILURE!
> java.lang.AssertionError: Did not throw zookeeper connection loss exceptions!
>       at org.junit.Assert.fail(Assert.java:88)
>       at 
> org.apache.hadoop.ha.TestActiveStandbyElector.testWithoutZKServer(TestActiveStandbyElector.java:722)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to