KAFKA-4588: Wait for topics to be created in QueryableStateIntegrationTest.shouldNotMakeStoreAvailableUntilAllStoresAvailable#2371
Conversation
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
I have a clarification question about the issue, which is not directly related to this test failure: in practice, it is likely that So when you say test hangs as no tasks gets assigned, which line of code is specifically causing this issue, is it because of this: |
|
@guozhangwang it isn't an issue with What happen is we call The assignment never happens again (at least not within the 30 seconds the test runs for) |
|
This might fix |
|
Refer to this link for build results (access rights to CI server needed): |
guozhangwang
left a comment
There was a problem hiding this comment.
LGTM overall, left a single comment.
| } | ||
|
|
||
| public void waitForTopics(final StreamsConfig config, final String...topics) throws InterruptedException, IOException { | ||
| final StreamsKafkaClient streamsKafkaClient = new StreamsKafkaClient(config); |
There was a problem hiding this comment.
Instead of using a separate client, could we migrate the scala TestUtils.waitUntilMetadataIsPropagated code, that looks into broker.apis.metadataCache directly?
There was a problem hiding this comment.
by migrate I mean we can add a similar function in the java TestUtils class.
There was a problem hiding this comment.
sure i'll take a look at it.
There was a problem hiding this comment.
Hmm, can't add it the the java TestUtils class as clients doesn't have a dependency on core.
Thought i'd add it to StreamsTestUtils, but can't as it breaks checkstyle:
[ant:checkstyle] /Users/damian/dev/apache/kafka/streams/src/test/java/org/apache/kafka/test/StreamsTestUtils.java:18:1: Disallowed import - kafka.api.PartitionStateInfo.
[ant:checkstyle] /Users/damian/dev/apache/kafka/streams/src/test/java/org/apache/kafka/test/StreamsTestUtils.java:19:1: Disallowed import - kafka.api.Request.
[ant:checkstyle] /Users/damian/dev/apache/kafka/streams/src/test/java/org/apache/kafka/test/StreamsTestUtils.java:20:1: Disallowed import - kafka.server.KafkaServer.
[ant:checkstyle] /Users/damian/dev/apache/kafka/streams/src/test/java/org/apache/kafka/test/StreamsTestUtils.java:21:1: Disallowed import - kafka.server.MetadataCache.
[ant:checkstyle] /Users/damian/dev/apache/kafka/streams/src/test/java/org/apache/kafka/test/StreamsTestUtils.java:26:1: Disallowed import - scala.Option.
There was a problem hiding this comment.
Ok - i've moved it to IntegrationTestUtils as the org.apache.kafka.streams.integration package is already allowed to import most of these. I've had to add 1 more package to the allowed imports.
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
LGTM overall. Seems |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Is this test failure relevant? I thought it should be gone as well with the fix: https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/918/testReport/junit/org.apache.kafka.streams.integration/JoinIntegrationTest/testInnerKStreamKTable/ |
|
Refer to this link for build results (access rights to CI server needed): |
|
No. I haven't changed that test
…On Mon, 16 Jan 2017 at 21:50, asfbot ***@***.***> wrote:
Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/920/
Test FAILed (JDK 8 and Scala 2.11).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2371 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADWLSJYW8J3By8Hb0yFnc_jLoUC8LIdks5rS-YYgaJpZM4LjJls>
.
|
|
@dguy Do you think it makes sense to always enforce |
|
@guozhangwang Sure makes sense. I'll do that |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
…nTest.shouldNotMakeStoreAvailableUntilAllStoresAvailable After debugging this i can see the times that it fails there is a race between when the topic is actually created/ready on the broker and when the assignment happens. When it fails `StreamPartitionAssignor.assign(..)` gets called with a `Cluster` with no topics. Hence the test hangs as no tasks get assigned. To fix this I added a `waitForTopics` method to `EmbeddedKafkaCluster`. This will wait until the topics have been created. Author: Damian Guy <damian.guy@gmail.com> Reviewers: Matthias J. Sax, Guozhang Wang Closes #2371 from dguy/integration-test-fix (cherry picked from commit 825f225) Signed-off-by: Guozhang Wang <wangguoz@gmail.com>
|
Thanks @dguy . Merged to trunk and piggy-backed to 0.10.2. |
|
@guozhangwang |
…nTest.shouldNotMakeStoreAvailableUntilAllStoresAvailable After debugging this i can see the times that it fails there is a race between when the topic is actually created/ready on the broker and when the assignment happens. When it fails `StreamPartitionAssignor.assign(..)` gets called with a `Cluster` with no topics. Hence the test hangs as no tasks get assigned. To fix this I added a `waitForTopics` method to `EmbeddedKafkaCluster`. This will wait until the topics have been created. Author: Damian Guy <damian.guy@gmail.com> Reviewers: Matthias J. Sax, Guozhang Wang Closes apache#2371 from dguy/integration-test-fix
After debugging this i can see the times that it fails there is a race between when the topic is actually created/ready on the broker and when the assignment happens. When it fails
StreamPartitionAssignor.assign(..)gets called with aClusterwith no topics. Hence the test hangs as no tasks get assigned. To fix this I added awaitForTopicsmethod toEmbeddedKafkaCluster. This will wait until the topics have been created.