Skip to content

Fix temporal ITs to only generate DST-safe time #344

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

Merged
merged 1 commit into from
Apr 5, 2018

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Apr 4, 2018

Randomized tests for DateTime Cypher type generate random date-time values with time zone (either offset or id). They used to be flaky because sometimes generated instant was invalid. Such instant pointed to a non-existing time during a Daylight Saving Time adjustment/jump. Such time values are adjusted to the nearest valid value by the database. This made tests fail because received value was different from the sent value.

This PR fixes the problem by making random DateTime generator never generate hour of the day that is in the DST adjustment range. It also reduces the number of test time zones to couple popular ones. This is done to make sure all tested time zones are supported by the JVM, neo4j database is running on.

Randomized tests for `DateTime` Cypher type generate random date-time
values with time zone (either offset or id). They used to be flaky
because sometimes generated instant was invalid. Such instant pointed
to a non-existing time during a Daylight Saving Time adjustment/jump.
Such time values are adjusted to the nearest valid value by the
database. This made tests fail because received value was different
from the sent value.

This commit fixes the problem by making random `DateTime` generator
never generate hour of the day that is in the DST adjustment range. It
also reduces the number of test time zones to couple popular ones. This
is done to make sure all tested time zones are supported by the JVM,
neo4j database is running on.
@lutovich lutovich requested a review from ali-ince April 4, 2018 15:36
@ali-ince ali-ince merged commit 220c827 into neo4j:1.6 Apr 5, 2018
@lutovich lutovich deleted the 1.6-temporal-its-valid-time branch April 5, 2018 09:41
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.

2 participants