You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Kevin Risden (JIRA)" <ji...@apache.org> on 2018/11/01 21:05:00 UTC
[jira] [Commented] (KNOX-1548) Improve
ZooKeeperConfigurationMonitorTest to not use Thread.sleep()
[ https://issues.apache.org/jira/browse/KNOX-1548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16672199#comment-16672199 ]
Kevin Risden commented on KNOX-1548:
------------------------------------
[~pzampino] - Thoughts on the above patch? Waits a maximum of 1 seconds for changes to be propagated. Will short circuit if condition is met sooner.
> Improve ZooKeeperConfigurationMonitorTest to not use Thread.sleep()
> -------------------------------------------------------------------
>
> Key: KNOX-1548
> URL: https://issues.apache.org/jira/browse/KNOX-1548
> Project: Apache Knox
> Issue Type: Test
> Reporter: Kevin Risden
> Assignee: Kevin Risden
> Priority: Minor
> Fix For: 1.2.0
>
> Attachments: KNOX-1548.patch
>
>
> Currently ZooKeeperConfigurationMonitorTest uses Thread.sleep(100). This causes periodic failures on loaded machines since the condition isn't met after 100ms. Instead we should check for a condition and timeout after some time.
> {code:java}
> [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.407 s <<< FAILURE! - in org.apache.knox.gateway.topology.monitor.ZooKeeperConfigurationMonitorTest
> [ERROR] testZooKeeperConfigMonitor(org.apache.knox.gateway.topology.monitor.ZooKeeperConfigurationMonitorTest) Time elapsed: 0.327 s <<< FAILURE!
> java.lang.AssertionError
> at org.apache.knox.gateway.topology.monitor.ZooKeeperConfigurationMonitorTest.testZooKeeperConfigMonitor(ZooKeeperConfigurationMonitorTest.java:202){code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)