Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2608] Fixed Non-deterministic behavior of HashMap that might fail tests using ContentFragment.getExportedElements() #2629

Merged
merged 3 commits into from
Dec 27, 2023

Conversation

SaaiVenkat
Copy link
Contributor

Q A
Fixed Issues? Fixes #2608
Patch: Bug Fix? Yes
Minor: New Feature? No
Major: Breaking Change? No
Tests Added + Pass? Tests Pass
Documentation Provided No (Added Code Comments)
Any Dependency Changes? No
License Apache License, Version 2.0
  • Since the change in ordering of elements loaded by resource.getChild() when mocking the ContentFragment causes the issue, sorting the elements loaded by the resource will solve the issue.
  • Sorting the elements based on the property name ensures that the elements are always returned in a deterministic order.
  • I have used streams().sorted() to sort the key set, and I have collected the values in List to make sure the order remains constant across different runs.

SaaiVenkat and others added 3 commits October 17, 2023 23:33

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@SaaiVenkat SaaiVenkat changed the title [2608] Fixed Non-deterministic behavior of HashMap that might fail tests using ContentFragment.getExportedElements() [2608] Fixed Non-deterministic behavior of HashMap that might fail tests using ContentFragment.getExportedElements() Dec 1, 2023
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (14e70e3) 87.34% compared to head (2b97292) 87.34%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2629   +/-   ##
=========================================
  Coverage     87.34%   87.34%           
  Complexity     2648     2648           
=========================================
  Files           232      232           
  Lines          7080     7080           
  Branches       1073     1073           
=========================================
  Hits           6184     6184           
  Misses          359      359           
  Partials        537      537           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vladbailescu vladbailescu merged commit 59f21d9 into adobe:main Dec 27, 2023
@LSantha LSantha added this to the 2.24.0 milestone Feb 14, 2024
@SaaiVenkat SaaiVenkat deleted the improvement/fix-flaky-test branch October 1, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants