MenoData / Time4J

Advanced date, time and interval library for Java with sun/moon-astronomy and calendars like Chinese, Coptic, Ethiopian, French Republican, Hebrew, Hijri, Historic Christian, Indian National, Japanese, Julian, Korean, Minguo, Persian, Thai, Vietnamese
GNU Lesser General Public License v2.1
424 stars 62 forks source link

Test fails during build #961

Closed hylkevds closed 2 years ago

hylkevds commented 2 years ago

Using mvn install gives an error during unit testing.

Full build log: https://github.com/hylkevds/Time4J/runs/4564324156?check_suite_focus=true#step:4:6711

Error:  Failures: 
Error:    IntervalCollectionTest.collectionOfInstantIntervals:1267 
Expected: is <[[2021-12-17T19:03:21.211193Z/2021-12-17T19:03:22.211193Z)]>
     but: was <[[2021-12-17T19:03:21.211199Z/2021-12-17T19:03:22.211193Z)]>
MenoData commented 2 years ago

Thank you for your contribution. Although I cannot reproduce it on my machine (which has probably less than microsecond precision), I can indeed see what was wrong. The expression Instant.now() must not be called more than once during test method in order to avoid such microsecond deltas.

MenoData commented 2 years ago

I have now fixed it. Please give me feedback if your build now succeeds.

hylkevds commented 2 years ago

Yep, works fine now. Thanks for the quick fix!