kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: MINOR: Use `waitUntil` to fix transient failures of ControllerFailoverTest
Date Wed, 31 May 2017 22:47:22 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.11.0 3bc173436 -> 93308d101


MINOR: Use `waitUntil` to fix transient failures of ControllerFailoverTest

Without it, it's possible that the assertion is checked before the exception
is thrown in the callback.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #3182 from ijuma/fix-controller-failover-flakiness

(cherry picked from commit eeb8f67810e2b02ee73eeb3a784e365b7b780f47)
Signed-off-by: Ismael Juma <ismael@juma.me.uk>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/93308d10
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/93308d10
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/93308d10

Branch: refs/heads/0.11.0
Commit: 93308d101c5ae80ffcdaf04767beb4b2451db789
Parents: 3bc1734
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Wed May 31 23:47:11 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Wed May 31 23:47:30 2017 +0100

----------------------------------------------------------------------
 .../test/scala/unit/kafka/controller/ControllerFailoverTest.scala  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/93308d10/core/src/test/scala/unit/kafka/controller/ControllerFailoverTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/controller/ControllerFailoverTest.scala b/core/src/test/scala/unit/kafka/controller/ControllerFailoverTest.scala
index c17ec6a..13b7285 100644
--- a/core/src/test/scala/unit/kafka/controller/ControllerFailoverTest.scala
+++ b/core/src/test/scala/unit/kafka/controller/ControllerFailoverTest.scala
@@ -81,7 +81,7 @@ class ControllerFailoverTest extends KafkaServerTestHarness with Logging
{
     TestUtils.waitUntilTrue(() => !initialController.kafkaScheduler.isStarted, "Scheduler
was not shutdown")
     TestUtils.waitUntilTrue(() => !initialController.isActive, "Controller did not become
inactive")
     latch.countDown()
-    assertTrue("handleIllegalState did not throw an exception", exceptionThrown.isDefined)
+    TestUtils.waitUntilTrue(() => exceptionThrown.isDefined, "handleIllegalState did not
throw an exception")
     assertTrue(s"handleIllegalState should throw an IllegalStateException, but $exceptionThrown
was thrown",
       exceptionThrown.get.isInstanceOf[IllegalStateException])
 


Mime
View raw message