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

Hibernate ORM and Spring Data tests failing with out-by-one error when run on Mac in North American timezone #28035

Open
holly-cummins opened this issue Sep 17, 2022 · 14 comments · Fixed by #28044
Labels
area/hibernate-orm Hibernate ORM area/spring Issues relating to the Spring integration env/m1 Impacts Apple M1 machines kind/bug Something isn't working

Comments

@holly-cummins
Copy link
Contributor

holly-cummins commented Sep 17, 2022

Describe the bug

I can’t decide if this is a test issue, or an implementation issue, but I’m raising a defect to track the investigation (and track the disabling of the tests on Mac CIs in #27156, which we will want to reverse once this is sorted out).

A number of tests which check author.dob are failing with an out-by-one error, on our Mac GitHub runner. I assume the issue is a timezone one, since taking five hours off a date (as in UTC-5) can have the effect of going back a day. I have confirmed that I can reproduce on my Mac if I set the timezone to Chicago.

2022-09-17T06:31:57.7517920Z java.lang.AssertionError: 
2022-09-17T06:31:57.7518080Z 1 expectation failed.
2022-09-17T06:31:57.7527070Z JSON path author.dob doesn't match.
2022-09-17T06:31:57.7527270Z Expected: is "1821-11-11"
2022-09-17T06:31:57.7527420Z   Actual: 1821-11-10
```



I can’t explain why this only affects the Mac runner, and not the other US-hosted runners. (I’ve checked, and the timestamps in the log are the same as the ubuntu runners which pass fine.)





These are the affected tests:

📦 integration-tests/hibernate-orm-rest-data-panache
✖ io.quarkus.it.hibernate.orm.rest.data.panache.HibernateOrmRestDataPanacheTest.shouldGetAuthor line 51 -
✖ io.quarkus.it.hibernate.orm.rest.data.panache.HibernateOrmRestDataPanacheTest.shouldGetBookHal line 82 -
✖ io.quarkus.it.hibernate.orm.rest.data.panache.HibernateOrmRestDataPanacheTest.shouldGetBook line 70 -
✖ io.quarkus.it.hibernate.orm.rest.data.panache.HibernateOrmRestDataPanacheTest.shouldListAuthors line 97 -
✖ io.quarkus.it.hibernate.orm.rest.data.panache.HibernateOrmRestDataPanacheTest.shouldListBooksHal line 134 -
✖ io.quarkus.it.hibernate.orm.rest.data.panache.HibernateOrmRestDataPanacheTest.shouldListBooks line 109 -

📦 integration-tests/jackson
✖ io.quarkus.it.jackson.DateDeserializerPojoResourceTest.testSqlDate line 41 -

📦 integration-tests/spring-data-rest
✖ io.quarkus.it.spring.data.rest.SpringDataRestTest.shouldGetAuthor line 43 -
✖ io.quarkus.it.spring.data.rest.SpringDataRestTest.shouldGetBookHal line 67 -
✖ io.quarkus.it.spring.data.rest.SpringDataRestTest.shouldGetBook line 55 -
✖ io.quarkus.it.spring.data.rest.SpringDataRestTest.shouldListAuthors line 82 -
✖ io.quarkus.it.spring.data.rest.SpringDataRestTest.shouldListBooksHal line 106 -
✖ io.quarkus.it.spring.data.rest.SpringDataRestTest.shouldListBooks line 94 -

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

To reproduce, I think you will need a Mac? But probably not specifically an M1?

Change the timezone to something West of Greenwich, like a North American or Brazilian time (hi, @gastaldi :) ).

Then

mvn verify -f integration-tests/hibernate-orm-rest-data-panache

will fail.

Output of uname -a or ver

Darwin hcummins-mac 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 arm64

@holly-cummins holly-cummins added the kind/bug Something isn't working label Sep 17, 2022
@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE area/spring Issues relating to the Spring integration env/m1 Impacts Apple M1 machines labels Sep 17, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 17, 2022

/cc @Sanne, @gastaldi, @geoand, @gsmet, @yrodiere

geoand added a commit to geoand/quarkus that referenced this issue Sep 19, 2022
These tests are not taking timezones properly into account,
but they also don't really need to fully test the date handling,
so we relax them a bit.

Closes: quarkusio#28035
@geoand
Copy link
Contributor

geoand commented Sep 19, 2022

Although #28044 does not really answer why this is happening on M1 test runners, it nonetheless does allow us to progress

yrodiere added a commit that referenced this issue Sep 19, 2022
Relax testing constraints on certain dates tests
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Sep 19, 2022
@holly-cummins
Copy link
Contributor Author

Super-quick fix! Can this work item also take responsibility for reversing the changes made in #27156 to disable the tests, please? Otherwise it will be delaying #27156 because 27156 will need to be revised to un-disable the tests and then do another CI run. (I think delaying getting M1 into the build was perhaps the opposite of the intention of the changes here.)

@geoand
Copy link
Contributor

geoand commented Sep 19, 2022

@holly-cummins done!

I rebased and force pushed to your branch so the PR is updated

@holly-cummins
Copy link
Contributor Author

Oh, sorry, @geoand , I meant the opposite! I meant could we leave my branch alone to improve the chances of a green run on that branch, and use this work item to track re-enabling the tests, after the M1 changes have merged. The M1 PR is struggling to get in so I was hoping to minimise further changes on that branch so I don't have to keep waiting for full-build cycles.

Ah well! Hopefully tomorrow will be the day for the M1 PR (fingers crossed!)

@geoand
Copy link
Contributor

geoand commented Sep 19, 2022

Oh, sorry!

@holly-cummins
Copy link
Contributor Author

We still see some of date-related failures on M1, so this should perhaps be re-opened. Fixes would need to be tested with #28082:

📦 integration-tests/hibernate-orm-graphql-panache

✖ io.quarkus.it.hibertnate.orm.graphql.panache.HibernateOrmGraphQLPanacheTest.testEndpoint line 63 - [More details](https://github.com/quarkusio/quarkus/runs/8447795060#user-content-test-failure-io.quarkus.it.hibertnate.orm.graphql.panache.hibernateormgraphqlpanachetest-1) - [Source on GitHub](https://github.com/quarkusio/quarkus/blob/94fe4a724135efebb6130827f666e922838e8254/integration-tests/hibernate-orm-graphql-panache/src/test/java/io/quarkus/it/hibertnate/orm/graphql/panache/HibernateOrmGraphQLPanacheTest.java#L63)
📦 integration-tests/jackson

✖ io.quarkus.it.jackson.DateDeserializerPojoResourceTest.testSqlDate line 42 - [More details](https://github.com/quarkusio/quarkus/runs/8447795060#user-content-test-failure-io.quarkus.it.jackson.datedeserializerpojoresourcetest-1) - [Source on GitHub](https://github.com/quarkusio/quarkus/blob/94fe4a724135efebb6130827f666e922838e8254/integration-tests/jackson/src/test/java/io/quarkus/it/jackson/DateDeserializerPojoResourceTest.java#L42)

@geoand geoand reopened this Sep 20, 2022
@gsmet gsmet modified the milestones: 2.14 - main, 2.13.0.Final Sep 20, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Sep 20, 2022
These tests are not taking timezones properly into account,
but they also don't really need to fully test the date handling,
so we relax them a bit.

Closes: quarkusio#28035
(cherry picked from commit a6e79ff)
@gsmet gsmet removed this from the 2.13.0.Final milestone Sep 21, 2022
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
These tests are not taking timezones properly into account,
but they also don't really need to fully test the date handling,
so we relax them a bit.

Closes: quarkusio#28035
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
These tests are not taking timezones properly into account,
but they also don't really need to fully test the date handling,
so we relax them a bit.

Closes: quarkusio#28035
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
These tests are not taking timezones properly into account,
but they also don't really need to fully test the date handling,
so we relax them a bit.

Closes: quarkusio#28035
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 17, 2022
These tests are not taking timezones properly into account,
but they also don't really need to fully test the date handling,
so we relax them a bit.

Closes: quarkusio#28035
@geoand
Copy link
Contributor

geoand commented Nov 23, 2022

Is this still an issue?

@holly-cummins
Copy link
Contributor Author

I suspect it is, and that we don't see it every day because the tests are disabled. I've rebased #28082 (which enables the tests and shows the problem) to force a new build so we can check.

@geoand
Copy link
Contributor

geoand commented Nov 23, 2022

Great, thanks

@holly-cummins
Copy link
Contributor Author

Confirming this is still an issue. https://github.com/quarkusio/quarkus/runs/9674074039 shows the problem. It's been dealt with at the moment by disabling the tests, which isn't ideal for a number of reasons.

📦 integration-tests/hibernate-orm-graphql-panache

✖ io.quarkus.it.hibertnate.orm.graphql.panache.HibernateOrmGraphQLPanacheTest.testEndpoint line 63 - [More details](https://github.com/quarkusio/quarkus/runs/9674074039#user-content-test-failure-io.quarkus.it.hibertnate.orm.graphql.panache.hibernateormgraphqlpanachetest-1) - [Source on GitHub](https://github.com/quarkusio/quarkus/blob/43bba01371c1e02401c91c0833d9f69ab36a8743/integration-tests/hibernate-orm-graphql-panache/src/test/java/io/quarkus/it/hibertnate/orm/graphql/panache/HibernateOrmGraphQLPanacheTest.java#L63)
📦 integration-tests/jackson

✖ io.quarkus.it.jackson.DateDeserializerPojoResourceTest.testSqlDate line 42 - [More details](https://github.com/quarkusio/quarkus/runs/9674074039#user-content-test-failure-io.quarkus.it.jackson.datedeserializerpojoresourcetest-1) - [Source on GitHub](https://github.com/quarkusio/quarkus/blob/43bba01371c1e02401c91c0833d9f69ab36a8743/integration-tests/jackson/src/test/java/io/quarkus/it/jackson/DateDeserializerPojoResourceTest.java#L42)

To expose the problem:

@holly-cummins
Copy link
Contributor Author

If it makes us feel any better, dates and times are hard. I mean, we knew that already, but I just saw this on the website of a major company in the finance industry:

image

@Sanne
Copy link
Member

Sanne commented Dec 14, 2022

When I see such funny date blunders, one part of me grins, the other part wonders if it's "our" fault :)

@yrodiere yrodiere removed the area/persistence OBSOLETE, DO NOT USE label Aug 14, 2024
@aureamunoz
Copy link
Member

cc @aureamunoz I add it to my backlog for checking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/spring Issues relating to the Spring integration env/m1 Impacts Apple M1 machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants