Skip to content

Test issue: JDBCTimeZoneZonedTest #1724

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

Closed
Sanne opened this issue Aug 3, 2023 · 4 comments · Fixed by #2071
Closed

Test issue: JDBCTimeZoneZonedTest #1724

Sanne opened this issue Aug 3, 2023 · 4 comments · Fixed by #2071
Assignees
Labels
good first issue Good for newcomers testing Improvements to test suite
Milestone

Comments

@Sanne
Copy link
Member

Sanne commented Aug 3, 2023

This failed today with error:

java.util.concurrent.CompletionException: org.opentest4j.AssertionFailedError: 
expected: 2023-08-03T09:50:51.570Z
 but was: 2023-08-03T09:50:51.569999Z
when comparing values using Comparator$$Lambda$251/0x00000008010d4808
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)

The actual value is extremely close to the expectation, seems like a problem of lack of precision during conversions, most likely unavoidable? Perhaps all we need is to allow some margin of error.

@Sanne Sanne added good first issue Good for newcomers testing Improvements to test suite labels Aug 3, 2023
@relentless-pursuit
Copy link

I was able to reproduce the issue.

org.opentest4j.AssertionFailedError: [Comparing nanoseconds of z.zonedDateTime with z.offsetDateTime] 
expected: 120643000
 but was: 120618000
java.util.concurrent.CompletionException: org.opentest4j.AssertionFailedError: [Comparing nanoseconds of z.zonedDateTime with z.offsetDateTime] 
expected: 120643000
 but was: 120618000

I made comparison between the nanosecond part of z.zonedDateTime and nanosecond part of z.offsetDateTime. But, I was able to reproduce the issue with a custom unit test method. I didn't get any assertion failure while running the test method of JDBCTimeZoneZonedTest.

@relentless-pursuit
Copy link

Also, we are already using roundToDefaultPrecision. I assume it should take care of some fractional difference. But, if not, shall i proceed with creating a custom rounding logic?

@DavideD
Copy link
Member

DavideD commented Aug 9, 2023

I haven't checked the code, but rounding to the default precision makes sense to me.
I would avoid custom logic.

@DavideD DavideD self-assigned this Sep 14, 2023
@DavideD
Copy link
Member

DavideD commented Feb 12, 2024

The same issue also happens from time to time with ColumnZonedTest.

But we already truncate and use roundToDefaultPrecision. I will try to have a better look when I have time

@DavideD DavideD added this to the next milestone Sep 5, 2024
@DavideD DavideD added problem A limitation or source of discomfort and removed problem A limitation or source of discomfort labels Dec 6, 2024
@DavideD DavideD changed the title Test issue: JDBCTimeZoneZonedTest Test issue: JDBCTimeZoneZonedTest Dec 17, 2024
@DavideD DavideD removed their assignment Dec 18, 2024
@dreab8 dreab8 self-assigned this Jan 20, 2025
dreab8 added a commit to dreab8/hibernate-reactive that referenced this issue Jan 21, 2025
…robably due lack of database Timestamp precision
dreab8 added a commit to dreab8/hibernate-reactive that referenced this issue Jan 21, 2025
…es probably due lack of database Timestamp precision
dreab8 added a commit to dreab8/hibernate-reactive that referenced this issue Jan 21, 2025
…es probably due lack of database Timestamp precision
dreab8 added a commit to dreab8/hibernate-reactive that referenced this issue Jan 21, 2025
DavideD pushed a commit that referenced this issue Jan 21, 2025
DavideD pushed a commit to DavideD/hibernate-reactive that referenced this issue Jan 22, 2025
…es probably due lack of database Timestamp precision
DavideD pushed a commit to DavideD/hibernate-reactive that referenced this issue Jan 22, 2025
DavideD pushed a commit that referenced this issue Jan 23, 2025
DavideD pushed a commit that referenced this issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers testing Improvements to test suite
Projects
None yet
4 participants