Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-1548

Improve ZooKeeperConfigurationMonitorTest to not use Thread.sleep()

    XMLWordPrintableJSON

Details

    • Test
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.0
    • None
    • None

    Description

      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.

      [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)

      Attachments

        1. KNOX-1548.patch
          8 kB
          Kevin Risden

        Activity

          People

            krisden Kevin Risden
            krisden Kevin Risden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: