You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "sjhajharia (via GitHub)" <gi...@apache.org> on 2025/07/23 03:07:59 UTC
[PR] MINOR: Fix flaky tests in ShareGroupCommandTest [kafka]
sjhajharia opened a new pull request, #20225:
URL: https://github.com/apache/kafka/pull/20225
### Problem
The `ShareGroupCommandTest.testDeleteShareGroupOffsetsArgsWithoutTopic()` and `ShareGroupCommandTest.testDeleteShareGroupOffsetsArgsWithoutGroup()` tests were flaky due to a dependency on Set iteration order in error message generation.
### Root Cause
The cleanup commit that replaced `new HashSet<>(Arrays.asList(...))` with `Set.of(...)` in ShareGroupCommandOptions changed the iteration characteristics of collections used for error message generation:
This produces different orders like `[topic], [group]` vs `[group], [topic]`, but the tests expected a specific order, causing intermittent failures.
### Solution
Fix the root cause by ensuring deterministic error message generation through alphabetical sorting of option names.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Fix flaky tests in Tools modules [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky merged PR #20225:
URL: https://github.com/apache/kafka/pull/20225
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Fix flaky tests in Tools modules [kafka]
Posted by "fvaleri (via GitHub)" <gi...@apache.org>.
fvaleri commented on code in PR #20225:
URL: https://github.com/apache/kafka/pull/20225#discussion_r2224696914
##########
tools/src/main/java/org/apache/kafka/tools/consumer/group/ShareGroupCommandOptions.java:
##########
@@ -159,11 +159,11 @@ public void checkArgs() {
if (options.has(describeOpt)) {
if (!options.has(groupOpt) && !options.has(allGroupsOpt))
CommandLineUtils.printUsageAndExit(parser,
- "Option " + describeOpt + " takes one of these options: " + allGroupSelectionScopeOpts.stream().map(Object::toString).collect(Collectors.joining(", ")));
+ "Option " + describeOpt + " takes one of these options: " + allGroupSelectionScopeOpts.stream().map(Object::toString).sorted().collect(Collectors.joining(", ")));
Review Comment:
What about using `LinkedHashSet` when group of options are created and avoid repeated sorting?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org