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

[FEA] Make sure that we test odd time zones in addition to common ones #9633

Open
revans2 opened this issue Nov 3, 2023 · 2 comments
Open
Assignees
Labels
feature request New feature or request test Only impacts tests

Comments

@revans2
Copy link
Collaborator

revans2 commented Nov 3, 2023

Is your feature request related to a problem? Please describe.
There is some work to try and add some tests for time zones beyond UTC. #9627

Ideally we don't just test one or two hard coded time zones, but instead we randomly pick a timezone to test with and that we try and favor some of the really odd ones so we can have confidence that we have the common ones covered too.

https://www.worldtimeserver.com/learn/unusual-time-zones/

@revans2 revans2 added feature request New feature or request ? - Needs Triage Need team to review and classify test Only impacts tests labels Nov 3, 2023
@revans2
Copy link
Collaborator Author

revans2 commented Nov 6, 2023

Just for reference we might need to translate some of these to things java understands. https://code2care.org/pages/java-timezone-list-utc-gmt-offset/

@sperlingxx
Copy link
Collaborator

sperlingxx commented Dec 8, 2023

Firstly, I ran the UT TimeZoneSuite with AllTimezones (but not AllYears). It took about 30min to finish all zones successfully.

Then, I tried to pick up some "weird zones" according to some simple rules:

  1. Zones contain the most transitions
ZoneId.getAvailableZoneIds().asScala.map { id => (ZoneId.of(id).normalized().getRules().getTransitions().asScala.size, id) }.toList.sortBy(-_._1).slice(0, 10).foreach(println)
(307,Asia/Hebron)
(305,Asia/Gaza)
(196,Africa/Casablanca)
  1. Zones contain the intra-hour transitions ( Ex: Transition[Overlap at 1921-02-13T00:00-05:30 to -06:00])
ZoneId.getAvailableZoneIds().asScala.map { id => (ZoneId.of(id).normalized().getRules().getTransitions().asScala.filter(e => e.getDuration().getSeconds() % 3600 > 0).size, id) }.toList.sortBy(-_._1).slice(0,10).foreach(println)
(45,America/Belize)
(26,Australia/Lord_Howe)
(26,Australia/LHI)
  1. Zones contain the intra-minute transitions ( Ex: Transition[Gap at 1890-01-01T00:00-04:43:40 to -04:42:45])
ZoneId.getAvailableZoneIds().asScala.map { id => (ZoneId.of(id).normalized().getRules().getTransitions().asScala.filter(e => e.getDuration().getSeconds() % 60 > 0).size, id) }.toList.sortBy(-_._1).slice(0,10).foreach(println)
(4,America/Punta_Arenas)
(3,America/Santiago)
(3,Chile/Continental)
  1. According to https://www.oracle.com/java/technologies/tzdata-versions.html, we choose Morocco because it frequently changes its transition rule.

Maybe we can pick up several of them into our pre-merge and nightly tests? Such as #9999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request test Only impacts tests
Projects
None yet
Development

No branches or pull requests

3 participants