Skip to content

KAFKA-9273: Extract testShouldAutoShutdownOnIncompleteMetadata from S…#9108

Merged
bbejeck merged 4 commits intoapache:trunkfrom
albert02lowis:albert_asdf
Aug 15, 2020
Merged

KAFKA-9273: Extract testShouldAutoShutdownOnIncompleteMetadata from S…#9108
bbejeck merged 4 commits intoapache:trunkfrom
albert02lowis:albert_asdf

Conversation

@albert02lowis
Copy link
Copy Markdown
Contributor

@albert02lowis albert02lowis commented Jul 31, 2020

…treamTableJoinIntegrationTest into its own test

The main goal is to remove usage of embedded broker (EmbeddedKafkaCluster) in AbstractJoinIntegrationTest and its subclasses.
This is because the tests under this class are no longer using the embedded broker, except for two.
testShouldAutoShutdownOnIncompleteMetadata is one of such tests.
Furthermore, this test does not actually perfom stream-table join; it is testing an edge case of joining with a non-existent topic, so it should be in a separate test.

Testing strategy: run existing unit and integration test

@bbejeck

Committer Checklist (excluded from commit message)

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

Copy link
Copy Markdown

@abbccdda abbccdda left a comment

Choose a reason for hiding this comment

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

@bbejeck Could you take a look to make sure this is the only test which needs to be moving out?

@abbccdda
Copy link
Copy Markdown

retest this please

…treamTableJoinIntegrationTest into its own test

The main goal is to remove usage of embedded broker (EmbeddedKafkaCluster) in AbstractJoinIntegrationTest and its subclasses.
This is because the tests under this class are no longer using the embedded broker, except for two.
testShouldAutoShutdownOnIncompleteMetadata is one of such tests.
Furthermore, this test does not actually perfom stream-table join; it is testing an edge case of joining with a non-existent topic, so it should be in a separate test.
@albert02lowis
Copy link
Copy Markdown
Contributor Author

Hi, there's another unit test that need to be moved out (StreamStreamJoinIntegrationTest.shouldNotAccessJoinStoresWhenGivingName) but I thought of doing that in another PR (to make the PRs small). But let me know if it's ok to just include it in this PR.

(Btw, I force-push updated the commit with the right user email)

@abbccdda
Copy link
Copy Markdown

abbccdda commented Aug 1, 2020

@albert02lowis I see, let's try to do all of them in one PR then.

…amStreamJoinIntegrationTest into its own test.

shouldNotAccessJoinStoresWhenGivingName is the last unit test that has a dependency to embedded broker in AbstractJoinIntegrationTest.
This test does not actually test the behaviour of stream-stream join;
It is testing an edge case of accessing the store of a join, so it should be in a separate test.
…egrationTest.

The tests under AbstractJoinIntegrationTest previously requires embedded broker, but it is better to use TopologyTestDriver instead.
Existing stream-stream join tests that still make use of embedded broker is moved to use TopologyTestDriver, by specifying it under BOOTSTRAP_SERVERS_CONFIG.
And then the old EmbeddedKafkaCluster in AbstractJoinIntegrationTest is safely removed.
@albert02lowis
Copy link
Copy Markdown
Contributor Author

Hi @abbccdda sure thing, I have added 2 more commits to this PR and the unit + integration tests also looks good in my local

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 12, 2020

Ok to test

Copy link
Copy Markdown
Member

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

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

@albert02lowis thanks for the contribution. Overall the PR looks good to me, after the one comment is addressed we'll probably get this merged.

public static void setupConfigsAndUtils() {

STREAMS_CONFIG.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
STREAMS_CONFIG.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, CLUSTER.bootstrapServers());
Copy link
Copy Markdown
Member

@bbejeck bbejeck Aug 12, 2020

Choose a reason for hiding this comment

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

@albert02lowis I've confirmed locally that the test failures are related. The TopologyTestDriver still needs a bootstrap servers config value.
Adding something like STREAMS_CONFIG.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "test:0000"); into the AbstractJoinIntegrationTest.setupConfigsAndUtils() gets all tests passing.

I'm not sure how the JDK 14 tests passed as locally I got the same errors as the JDK 8 and 11 build locally.

Copy link
Copy Markdown
Contributor Author

@albert02lowis albert02lowis Aug 13, 2020

Choose a reason for hiding this comment

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

I see, let me add back this BOOTSTRAP_SERVERS_CONFIG inside setupConfigsAndUtils then 👍🏻

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.

Hi @bbejeck I have done the required change in a new commit. I have also extracted out redundant calls to set BOOTSTRAP_SERVERS_CONFIG in the subclasses' test methods.

…egrationTest.

Previously the setting of BOOTSTRAP_SERVERS_CONFIG is added on each test method, but this can actually be extracted to the BeforeClass method which is setupConfigsAndUtils in AbstractJoinIntegrationTest.
@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 13, 2020

retest this please

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 13, 2020

Retest this please.

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 13, 2020

Ok to test

@abbccdda
Copy link
Copy Markdown

retest this please

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 13, 2020

ok to test

Copy link
Copy Markdown
Member

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

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

Thanks for the update @albert02lowis, this LGTM. The streams build passed for me locally. Once we can get a build running here, I'll merge it.

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 14, 2020

retest this please

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 14, 2020

Java 8 failed on an unrelated test kafka.api.SaslSslConsumerTest.testCoordinatorFailover created a Jira ticket.

retest this please

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 14, 2020

Java 8 passed
Java 14 failed with org.apache.kafka.streams.integration.PurgeRepartitionTopicIntegrationTest.shouldRestoreState
Java 11 failed with kafka.api.PlaintextAdminIntegrationTest.testAlterReplicaLogDirs

retest this please

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 15, 2020

Java 11 passed
Java 14 failed due to Execution failed for task ':connect:api:javadoc'. ? (0 tests failed
Java 8 appears hung
Trying this one more time

retest this please

@bbejeck bbejeck merged commit 153db48 into apache:trunk Aug 15, 2020
@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Aug 15, 2020

merged #9108 into trunk

Thanks for the contribution @albert02lowis!

@albert02lowis
Copy link
Copy Markdown
Contributor Author

Thanks for the reviews too @bbejeck and @abbccdda ! Really excited as this is my first contribution 🙏🏻

@albert02lowis albert02lowis deleted the albert_asdf branch August 16, 2020 06:06
dima5rr pushed a commit to dima5rr/kafka that referenced this pull request Oct 5, 2020
apache#9108)

The main goal is to remove usage of embedded broker (EmbeddedKafkaCluster) in AbstractJoinIntegrationTest and its subclasses.
This is because the tests under this class are no longer using the embedded broker, except for two.
testShouldAutoShutdownOnIncompleteMetadata is one of such tests.
Furthermore, this test does not actually perfom stream-table join; it is testing an edge case of joining with a non-existent topic, so it should be in a separate test.

Testing strategy: run existing unit and integration test

Reviewers: Boyang Chen <boyang@confluent.io>, Bill Bejeck <bbejeck@apache.org>
urbandan pushed a commit to urbandan/kafka that referenced this pull request Oct 14, 2020
apache#9108)

The main goal is to remove usage of embedded broker (EmbeddedKafkaCluster) in AbstractJoinIntegrationTest and its subclasses.
This is because the tests under this class are no longer using the embedded broker, except for two.
testShouldAutoShutdownOnIncompleteMetadata is one of such tests.
Furthermore, this test does not actually perfom stream-table join; it is testing an edge case of joining with a non-existent topic, so it should be in a separate test.

Testing strategy: run existing unit and integration test

Reviewers: Boyang Chen <boyang@confluent.io>, Bill Bejeck <bbejeck@apache.org>
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