KAFKA-8014: Extend Connect integration tests to add and remove workers dynamically#6342
KAFKA-8014: Extend Connect integration tests to add and remove workers dynamically#6342rhauch merged 5 commits intoapache:trunkfrom
Conversation
|
@wicknicks @rhauch @hachikuji @ewencp this seems like a good initial extension before we introduce integration tests that test the Connect framework and its protocols. Flakiness has not been extensively assessed yet. I'll run a set of repeated run on a builder. |
fec691e to
1979434
Compare
rhauch
left a comment
There was a problem hiding this comment.
Looks great, and no major issues. A few very minor questions/comments below.
|
I've added a commit in this PR that should protect against flakiness. Currently an integration test's success depends on the connect cluster's ability to shutdown gracefully. But this should not be the case, since a test should depend on its assertions, but not in a service exiting with status 0. For example, an occasional failure on stopping a By adding a parameter in the builder we are stating our intent to allow for quick shutdowns of the services. |
|
Rebased on top of latest |
rhauch
left a comment
There was a problem hiding this comment.
Nice improvement on the exit conditions and checking!
There was a problem hiding this comment.
Seems like these might be useful in all integration tests that use this framework. Does it make sense to add them (or something similar) to the EmbeddedConnectCluster class? One, it helps emphasize that EmbeddedConnectCluster is really just for testing purposes and is not intended for embedding in production applications. Second, it allows other integration tests to much more easily do what this test class is doing by waiting until Connect gets to some desirable state.
There was a problem hiding this comment.
This thought crossed my mind too. But I think I'd prefer to move incrementally with what we can generalize and bring into EmbeddedConnectCluster. But totally agree. So far I've kept all the assertions in the test classes because I haven't conclusively decided on a pattern.
wicknicks
left a comment
There was a problem hiding this comment.
Thanks, @kkonstantine! Some questions/comments.
865f468 to
8916bd9
Compare
|
@rhauch @wicknicks latest build was green :) |
rhauch
left a comment
There was a problem hiding this comment.
A few super minor suggestions, and one question that I'd wish I'd seen earlier.
4a7e4e8 to
8827044
Compare
|
Thanks @rhauch |
rhauch
left a comment
There was a problem hiding this comment.
Excellent work, @kkonstantine. LGTM.
Thoughts, @wicknicks, since you've reviewed earlier versions of this PR? Also, how far back do we want to merge this?
|
Thanks @rhauch ! |
rhauch
left a comment
There was a problem hiding this comment.
Thanks, @kkonstantine. I did notice one more thing about the exit procedures; see below. Everything else looks great.
|
@wicknicks, any thoughts? |
wicknicks
left a comment
There was a problem hiding this comment.
almost there, @kkonstantine. some minor comments, and one comment/question. thanks!
KAFKA-8014: Use class instead of string to get class name to allow discoverability. KAFKA-8014: Choose whether to fail the test on ungraceful service shutdown KAFKA-8014: Prefer getOrDefault when parsing task configs KAFKA-8014: Abstract worker to its own handle KAFKA-8014: Add thread-safety note and log messages KAFKA-8014: Complete masking for exit and halt in embedded services
8827044 to
5e9a1e2
Compare
kkonstantine
left a comment
There was a problem hiding this comment.
Thanks @wicknicks
Your point regarding some missing assertions from the monitorable source was valid. So I added a few more assertions for records and commits in the handles.
@rhauch @wicknicks if you don't mind, since the changes are enough, could you review the latest commit? I hope it's in the right direction.
5e9a1e2 to
5d9e757
Compare
wicknicks
left a comment
There was a problem hiding this comment.
some minor comments. thanks for the quick turn around on this. really appreciate the changes.
also, were you planning on merging these changes back to 2.0 (since that's where we introduced these integration tests)?
kkonstantine
left a comment
There was a problem hiding this comment.
Thanks @wicknicks. I believe I addressed or replied to all your recent comments.
wicknicks
left a comment
There was a problem hiding this comment.
Thanks, @kkonstantine! LGTM.
|
Thanks @wicknicks ! |
…s dynamically (#6342) Extend Connect's integration test framework to add or remove workers to EmbeddedConnectCluster, and choosing whether to fail the test on ungraceful service shutdown. Also added more JavaDoc and other minor improvements. Author: Konstantine Karantasis <konstantine@confluent.io> Reviewers: Arjun Satish <arjun@confluent.io>, Randall Hauch <rhauch@gmail.com> Closes #6342 from kkonstantine/KAFKA-8014
…s dynamically (#6342) Extend Connect's integration test framework to add or remove workers to EmbeddedConnectCluster, and choosing whether to fail the test on ungraceful service shutdown. Also added more JavaDoc and other minor improvements. Author: Konstantine Karantasis <konstantine@confluent.io> Reviewers: Arjun Satish <arjun@confluent.io>, Randall Hauch <rhauch@gmail.com> Closes #6342 from kkonstantine/KAFKA-8014
* apache/trunk: (23 commits) KAFKA-7986: Distinguish logging from different ZooKeeperClient instances (apache#6493) KAFKA-8102: Add an interval-based Trogdor transaction generator (apache#6444) MINOR: Fix misspelling in protocol documentation KAFKA-8150: Fix bugs in handling null arrays in generated RPC code (apache#6489) KAFKA-8014: Extend Connect integration tests to add and remove workers dynamically (apache#6342) MINOR: Remove line for testing repartition topic name (apache#6488) MINOR: add MacOS requirement to Streams docs MINOR: fix message protocol help text for ElectPreferredLeadersResult (apache#6479) MINOR: list-topics should not require topic param MINOR: Clean up ThreadCacheTest (apache#6485) MINOR: Avoid unnecessary collection copy in MetadataCache (apache#6397) KAFKA-8142: Fix NPE for nulls in Headers (apache#6484) KAFKA-7243: Add unit integration tests to validate metrics in Kafka Streams (apache#6080) MINOR: Add verification step for Streams archetype to Jenkins build (apache#6431) KAFKA-7819: Improve RoundTripWorker (apache#6187) KAFKA-7989: RequestQuotaTest should wait for quota config change before running tests (apache#6482) KAFKA-8098: Fix Flaky Test testConsumerGroups KAFKA-6958: Add new NamedOperation interface to enforce consistency in naming operations (apache#6409) MINOR: capture result timestamps in Kafka Streams DSL tests (apache#6447) MINOR: updated names for deprecated streams constants (apache#6466) ...
…s dynamically (apache#6342) Extend Connect's integration test framework to add or remove workers to EmbeddedConnectCluster, and choosing whether to fail the test on ungraceful service shutdown. Also added more JavaDoc and other minor improvements. Author: Konstantine Karantasis <konstantine@confluent.io> Reviewers: Arjun Satish <arjun@confluent.io>, Randall Hauch <rhauch@gmail.com> Closes apache#6342 from kkonstantine/KAFKA-8014
Extend Connect's integration test harness to add the capability to add and remove workers dynamically as well as discover the set of active workers at any point during an integration test.
The current integration tests are extended to test the new capabilities.
Committer Checklist (excluded from commit message)