Skip to content

Conversation

@DL1231
Copy link
Collaborator

@DL1231 DL1231 commented Dec 19, 2025

Move KRaftClusterTest from core module to server module.
Rewrite

  • testCreateClusterAndPerformReassignment
  • testIncrementalAlterConfigs
  • testSetLog4jConfigurations
  • testCreatePartitions
  • testDescribeQuorumRequestToBrokers
  • testDescribeQuorumRequestToControllers
  • testUpdateMetadataVersion
  • testDescribeKRaftVersion
  • testCreateClusterAndCreateTopicWithRemoteLogManagerInstantiation

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) labels Dec 19, 2025
# Conflicts:
#	core/src/test/scala/integration/kafka/server/KRaftClusterTest.scala
#	server/src/test/java/org/apache/kafka/server/KRaftClusterTest.java
@chia7712
Copy link
Member

@DL1231 Could you merge trunk in to trigger CI again?

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@DL1231 thanks for this patch

@github-actions github-actions bot removed the triage PRs from the community label Dec 21, 2025
@DL1231 DL1231 requested a review from chia7712 December 22, 2025 02:02
values.get(resource).get();
return ApiError.NONE;
} catch (ExecutionException e) {
return ApiError.fromThrowable(e.getCause());
Copy link
Member

Choose a reason for hiding this comment

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

ApiError.fromThrowable already unwraps the exception, so we don't need to call getCause explictly

}
}

private void assertListEquals(List<ApiError> expected, List<ApiError> actual) {
Copy link
Member

Choose a reason for hiding this comment

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

Could we use assertIterableEquals(expected, actual); here instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason I've opted for the custom assertListEquals method is that the incrementalAlterConfigs API does not guarantee the order of the ApiError objects in its returned list.

As you know, assertIterableEquals performs a strict comparison that requires the elements in both iterables to be in the exact same sequence.

The current assertListEquals implementation correctly verifies that the actual list contains all the expected errors and no unexpected ones, but it does so without being sensitive to their order.

@DL1231 DL1231 requested a review from chia7712 December 25, 2025 00:58

for (int i = 0; i < 3; i++) {
int brokerId = i;
TestUtils.waitForCondition(
Copy link
Member

Choose a reason for hiding this comment

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

Can it be replaced by cluster.waitForReadyBrokers();?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@DL1231 DL1231 requested a review from chia7712 December 30, 2025 03:22
@chia7712 chia7712 merged commit 32efc1c into apache:trunk Dec 30, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants