MINOR: Make ControllerIntegrationTest less flaky#5829
MINOR: Make ControllerIntegrationTest less flaky#5829ijuma merged 1 commit intoapache:trunkfrom stanislavkozlovski:minor-controller-integration-test-flakiness
Conversation
There was a problem hiding this comment.
Perhaps we should do this with a single waitUntilTrue, so we only do a get when isDefined?
There was a problem hiding this comment.
Seems like we don't want to do a .get at all. We can compare with Some(...) instead.
There was a problem hiding this comment.
Why is AnyRef being passed as a parameter?
There was a problem hiding this comment.
getControllerEpoch returns a tuple of Option[(Int, Stat)]. Can we compare them in another way?
There was a problem hiding this comment.
This will never be true. What you want is zkClient.getControllerEpoch.map(_._1) == Some(epoch)
There was a problem hiding this comment.
That's true. I apparently haven't run the tests after that change ... embarrassing
I updated the PR now
`ControllerIntegrationTest#waitUntilControllerEpoch` sometimes fails with the following error: ``` java.util.NoSuchElementException: None.get at scala.None$.get(Option.scala:347) at scala.None$.get(Option.scala:345) at kafka.controller.ControllerIntegrationTest$$anonfun$waitUntilControllerEpoch$1.apply$mcZ$sp(ControllerIntegrationTest.scala:312) at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:779) at kafka.controller.ControllerIntegrationTest.waitUntilControllerEpoch(ControllerIntegrationTest.scala:312) at kafka.controller.ControllerIntegrationTest.testEmptyCluster(ControllerIntegrationTest.scala:51) ``` We should retry until the value is defined or it times out. Reviewers: Ismael Juma <ismael@juma.me.uk>
`ControllerIntegrationTest#waitUntilControllerEpoch` sometimes fails with the following error: ``` java.util.NoSuchElementException: None.get at scala.None$.get(Option.scala:347) at scala.None$.get(Option.scala:345) at kafka.controller.ControllerIntegrationTest$$anonfun$waitUntilControllerEpoch$1.apply$mcZ$sp(ControllerIntegrationTest.scala:312) at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:779) at kafka.controller.ControllerIntegrationTest.waitUntilControllerEpoch(ControllerIntegrationTest.scala:312) at kafka.controller.ControllerIntegrationTest.testEmptyCluster(ControllerIntegrationTest.scala:51) ``` We should retry until the value is defined or it times out. Reviewers: Ismael Juma <ismael@juma.me.uk>
|
Merged to trunk, 2.1 and 2.0 branches. |
`ControllerIntegrationTest#waitUntilControllerEpoch` sometimes fails with the following error: ``` java.util.NoSuchElementException: None.get at scala.None$.get(Option.scala:347) at scala.None$.get(Option.scala:345) at kafka.controller.ControllerIntegrationTest$$anonfun$waitUntilControllerEpoch$1.apply$mcZ$sp(ControllerIntegrationTest.scala:312) at kafka.utils.TestUtils$.waitUntilTrue(TestUtils.scala:779) at kafka.controller.ControllerIntegrationTest.waitUntilControllerEpoch(ControllerIntegrationTest.scala:312) at kafka.controller.ControllerIntegrationTest.testEmptyCluster(ControllerIntegrationTest.scala:51) ``` We should retry until the value is defined or it times out. Reviewers: Ismael Juma <ismael@juma.me.uk>
ControllerIntegrationTest#waitUntilControllerEpochsometimes fails with the following error:I think that ensuring the controllerEpoch is defined (by implicitly retrying) is a way to remove this error and fix cases where something transient has caused the method to return
None.