Skip to content

Conversation

@Kcruz28
Copy link
Contributor

@Kcruz28 Kcruz28 commented Dec 7, 2025

Type of change

  • Bugfix

Description

The fix addressed flaky test failures in the KafkaMirrorMaker2AssemblyOperatorPodSetTest.java file, specifically in the testScaleUpCluster method, where assertions on the labelSelector field were failing intermittently due to non-deterministic HashMap iteration order, as HashMap order is not always promised. Using NonDex, a tool that shuffles method executions to expose order-dependent bugs, I ran the tests over 100 times to confirm the flakiness stemmed from varying comma-separated label strings (e.g., "strimzi.io/cluster=my-mm2,strimzi.io/name=my-mm2-mirrormaker2,strimzi.io/kind=KafkaMirrorMaker2" vs. reordered versions). To resolve this, I replaced the direct string equality assertion with a Set-based comparison, splitting the labelSelector by commas and comparing unordered Sets, ensuring order independence and eliminating the HashMap variability.

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

…n for labelSelector to avoid order-dependent failures due to HashMap iteration

Signed-off-by: kcruz28 <[email protected]>
@Kcruz28 Kcruz28 force-pushed the fix-testScaleUpCluster branch from 9edd984 to 75e88e5 Compare December 7, 2025 08:49
@codecov
Copy link

codecov bot commented Dec 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.78%. Comparing base (77d6103) to head (75e88e5).
⚠️ Report is 40 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12211      +/-   ##
============================================
+ Coverage     74.76%   74.78%   +0.01%     
- Complexity     6616     6628      +12     
============================================
  Files           377      377              
  Lines         25329    25360      +31     
  Branches       3394     3402       +8     
============================================
+ Hits          18938    18966      +28     
- Misses         5003     5007       +4     
+ Partials       1388     1387       -1     

see 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scholzj scholzj requested a review from ppatierno December 7, 2025 16:18
@scholzj scholzj added this to the 0.50.0 milestone Dec 7, 2025
@scholzj
Copy link
Member

scholzj commented Dec 8, 2025

Thanks for the Pr.

@scholzj scholzj merged commit 372b1d4 into strimzi:main Dec 8, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants