Skip to content

Comments

[fix][test] Fixed Non-Guaranteed Order in PoliciesDataTest.propertyAdmin#24871

Merged
lhotari merged 1 commit intoapache:masterfrom
LucasEby:fix-propertyAdminHashOrdering
Nov 12, 2025
Merged

[fix][test] Fixed Non-Guaranteed Order in PoliciesDataTest.propertyAdmin#24871
lhotari merged 1 commit intoapache:masterfrom
LucasEby:fix-propertyAdminHashOrdering

Conversation

@LucasEby
Copy link
Contributor

Fixes #24870

Motivation

The below test performed an assertion that incorrectly assumed the order of the HashSet data that was utilized in the formation of one of the arrays. No guarantees are made to the iteration order of the set or that this order will remain constant over time. As a result, the ordering can change due to different environments producing the contents in different orders despite the logical contents being the same.

  • org.apache.pulsar.common.policies.data.PoliciesDataTest.propertyAdmin

In essence, these changes keep the spirit of the original tests while eliminating failures caused solely by the previously unexpected reordering the HashSet can induce onto the final array contents.

Modifications

The original test converted the HashSet data directly into an ArrayList, incorrectly assuming a consistent iteration order. We now sort the ArrayList prior to asserting to ensure deterministic ordering.

In essence, these changes keep the spirit of the original tests while eliminating failures caused solely by allowed (but previously unexpected) reordering.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as

  • org.apache.pulsar.common.policies.data.PoliciesDataTest.propertyAdmin

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: LucasEby#5

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Oct 18, 2025
@Technoboy- Technoboy- added this to the 4.2.0 milestone Oct 26, 2025
@Technoboy- Technoboy- closed this Oct 26, 2025
@Technoboy- Technoboy- reopened this Oct 26, 2025
@Technoboy-
Copy link
Contributor

/pulsarbot rerun-failure-checks

@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.21%. Comparing base (678db6b) to head (6d6d995).
⚠️ Report is 66 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24871      +/-   ##
============================================
- Coverage     74.34%   74.21%   -0.14%     
- Complexity    33496    34011     +515     
============================================
  Files          1913     1920       +7     
  Lines        149315   150232     +917     
  Branches      17331    17427      +96     
============================================
+ Hits         111012   111496     +484     
- Misses        29475    29838     +363     
- Partials       8828     8898      +70     
Flag Coverage Δ
inttests 26.31% <ø> (-0.79%) ⬇️
systests 22.82% <ø> (-0.20%) ⬇️
unittests 73.75% <ø> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 141 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LucasEby LucasEby force-pushed the fix-propertyAdminHashOrdering branch 2 times, most recently from f9d7783 to 7070d90 Compare November 11, 2025 16:02
@LucasEby LucasEby force-pushed the fix-propertyAdminHashOrdering branch from 7070d90 to 6d6d995 Compare November 11, 2025 16:28
@lhotari lhotari merged commit 2bf095d into apache:master Nov 12, 2025
54 of 55 checks passed
lhotari pushed a commit that referenced this pull request Nov 17, 2025
lhotari pushed a commit that referenced this pull request Nov 17, 2025
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 24, 2025
…min (apache#24871)

(cherry picked from commit 2bf095d)
(cherry picked from commit c46883b)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 25, 2025
…min (apache#24871)

(cherry picked from commit 2bf095d)
(cherry picked from commit c46883b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Incorrect Assumption on HashSet Iteration Order in PoliciesDataTest.propertyAdmin"

4 participants