Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Fixing flaky tests in DateTest4_indian and DateTest5_iso8601 #2148

Merged
merged 1 commit into from
Dec 10, 2018

Conversation

OrDTesters
Copy link
Contributor

test_date in DateTest4_indian and DateTest5_iso8601 has a test-order dependency and it fails when they are run by themselves.

test_date can be fixed by running a setup to change the time and locale to "Asia/Shanghai" and "China" (respectively). This setup is the same as the one in the DateTest class that these tests were depending on. The fix will enable test_date in the two classes to now pass in any test run order and by itself. Without the fix, the tests will get the following error. Let me know if you want to discuss more.

junit.framework.AssertionFailedError: 
Expected :83419000
Actual   :29419000
	at junit.framework.Assert.fail(Assert.java:57)
	at junit.framework.Assert.failNotEquals(Assert.java:329)
	at junit.framework.Assert.assertEquals(Assert.java:78)
	at junit.framework.Assert.assertEquals(Assert.java:159)
	at junit.framework.Assert.assertEquals(Assert.java:166)
	at junit.framework.TestCase.assertEquals(TestCase.java:324)
	at com.alibaba.json.bvt.serializer.date.DateTest5_iso8601.test_date(DateTest5_iso8601.java:27)

@codecov-io
Copy link

Codecov Report

Merging #2148 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2148      +/-   ##
============================================
- Coverage     81.67%   81.66%   -0.02%     
+ Complexity     6784     6780       -4     
============================================
  Files           140      140              
  Lines         25360    25360              
  Branches       6055     6055              
============================================
- Hits          20713    20709       -4     
- Misses         2930     2931       +1     
- Partials       1717     1720       +3
Impacted Files Coverage Δ Complexity Δ
...com/alibaba/fastjson/parser/JSONReaderScanner.java 72.61% <0%> (-1.28%) 44% <0%> (-1%)
...n/java/com/alibaba/fastjson/util/JavaBeanInfo.java 87.5% <0%> (-0.19%) 191% <0%> (-1%)
...java/com/alibaba/fastjson/parser/ParserConfig.java 82.38% <0%> (-0.19%) 185% <0%> (-1%)

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 6a5adc9...1fb1f23. Read the comment docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants