Skip to content

KAFKA-8014: Extend Connect integration tests to add and remove workers dynamically#6342

Merged
rhauch merged 5 commits intoapache:trunkfrom
kkonstantine:kafka-8014
Mar 25, 2019
Merged

KAFKA-8014: Extend Connect integration tests to add and remove workers dynamically#6342
rhauch merged 5 commits intoapache:trunkfrom
kkonstantine:kafka-8014

Conversation

@kkonstantine
Copy link
Copy Markdown
Contributor

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)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@kkonstantine
Copy link
Copy Markdown
Contributor Author

@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.

Copy link
Copy Markdown
Contributor

@rhauch rhauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, and no major issues. A few very minor questions/comments below.

@kkonstantine
Copy link
Copy Markdown
Contributor Author

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 KafkaBasedLog might lead to a test failing at times.

By adding a parameter in the builder we are stating our intent to allow for quick shutdowns of the services.

@kkonstantine
Copy link
Copy Markdown
Contributor Author

Rebased on top of latest trunk, triggering another test run

Copy link
Copy Markdown
Contributor

@rhauch rhauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement on the exit conditions and checking!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@wicknicks wicknicks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @kkonstantine! Some questions/comments.

@kkonstantine kkonstantine force-pushed the kafka-8014 branch 3 times, most recently from 865f468 to 8916bd9 Compare March 3, 2019 02:58
@kkonstantine
Copy link
Copy Markdown
Contributor Author

kkonstantine commented Mar 5, 2019

@rhauch @wicknicks latest build was green :)
Let me know if you have additional comments.
Will rebase a bit frequently to keep this PR up-to-date and use it as a base for KIP-415 PR as well.

Copy link
Copy Markdown
Contributor

@rhauch rhauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few super minor suggestions, and one question that I'd wish I'd seen earlier.

@kkonstantine kkonstantine force-pushed the kafka-8014 branch 2 times, most recently from 4a7e4e8 to 8827044 Compare March 6, 2019 20:52
@kkonstantine
Copy link
Copy Markdown
Contributor Author

kkonstantine commented Mar 6, 2019

Thanks @rhauch
Good catch on stop. I believe I now have addressed all the pending comments.
@wicknicks anything else that catches your attention?

Copy link
Copy Markdown
Contributor

@rhauch rhauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@kkonstantine
Copy link
Copy Markdown
Contributor Author

Thanks @rhauch !
I feel the additions can be a useful extension to integration tests.
I see the original PR has been merged/cherry-picked as far as 2.1.1 (please confirm). Of course, you might want to postpone cherry-picking and backporting so it doesn't interfere with any inflight releases (I think 2.2.0 is in RC mode). For KIP-415 that will consume these changes, trunk is fine too

Copy link
Copy Markdown
Contributor

@rhauch rhauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @kkonstantine. I did notice one more thing about the exit procedures; see below. Everything else looks great.

@rhauch
Copy link
Copy Markdown
Contributor

rhauch commented Mar 9, 2019

@wicknicks, any thoughts?

Copy link
Copy Markdown
Contributor

@wicknicks wicknicks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor Author

@kkonstantine kkonstantine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@wicknicks wicknicks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

@kkonstantine kkonstantine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wicknicks. I believe I addressed or replied to all your recent comments.

Copy link
Copy Markdown
Contributor

@wicknicks wicknicks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @kkonstantine! LGTM.

@kkonstantine
Copy link
Copy Markdown
Contributor Author

Thanks @wicknicks !
@rhauch any additional comments on the last commit? Or you think we are good to go?

@rhauch rhauch merged commit e4cad35 into apache:trunk Mar 25, 2019
rhauch pushed a commit that referenced this pull request Mar 25, 2019
…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
rhauch pushed a commit that referenced this pull request Mar 25, 2019
…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
jarekr pushed a commit to confluentinc/kafka that referenced this pull request Apr 18, 2019
* 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)
  ...
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants