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

Fix flaky test JSONPath_reverse_test #3530

Merged
merged 1 commit into from
Jul 10, 2021
Merged

Fix flaky test JSONPath_reverse_test #3530

merged 1 commit into from
Jul 10, 2021

Conversation

MengdiGao
Copy link
Contributor

Existing test is flaky because it relies on the ordering of elements in a map. To fix it, use SerializerFeature.MapSortField to force ordering when convert JSON to string, but the MapSortField config does not apply to list elements, so I manually compare all permutations of list elements.

The flaky test was found by running NonDex (https://github.com/TestingResearchIllinois/NonDex).

@codecov-io
Copy link

Codecov Report

Merging #3530 (133cca0) into master (8124e5e) will decrease coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3530      +/-   ##
============================================
- Coverage     80.46%   80.38%   -0.08%     
+ Complexity     7488     7486       -2     
============================================
  Files           157      157              
  Lines         27915    27929      +14     
  Branches       6731     6737       +6     
============================================
- Hits          22461    22452       -9     
- Misses         3445     3466      +21     
- Partials       2009     2011       +2     
Impacted Files Coverage Δ Complexity Δ
...com/alibaba/fastjson/serializer/SerialContext.java 82.69% <0.00%> (-3.85%) 21.00% <0.00%> (-1.00%)
...com/alibaba/fastjson/parser/JSONReaderScanner.java 73.58% <0.00%> (-1.26%) 45.00% <0.00%> (-1.00%)
...main/java/com/alibaba/fastjson/util/FieldInfo.java 85.76% <0.00%> (-1.00%) 96.00% <0.00%> (-3.00%)
src/main/java/com/alibaba/fastjson/JSONPath.java 75.32% <0.00%> (-0.49%) 275.00% <0.00%> (ø%)
...main/java/com/alibaba/fastjson/util/TypeUtils.java 79.21% <0.00%> (-0.12%) 654.00% <0.00%> (ø%)
...ain/java/com/alibaba/fastjson/asm/ClassReader.java 87.23% <0.00%> (-0.07%) 44.00% <0.00%> (ø%)
.../main/java/com/alibaba/fastjson/JSONValidator.java 64.72% <0.00%> (+0.34%) 56.00% <0.00%> (+1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8124e5e...133cca0. Read the comment docs.

@wenshao wenshao merged commit 6e956d2 into alibaba:master Jul 10, 2021
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.

None yet

3 participants