Skip to content

Consider removing timezones in tests that rely on tzdata-legacy #110488

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
richlander opened this issue Dec 6, 2024 · 6 comments
Closed

Consider removing timezones in tests that rely on tzdata-legacy #110488

richlander opened this issue Dec 6, 2024 · 6 comments
Assignees
Milestone

Comments

@richlander
Copy link
Member

richlander commented Dec 6, 2024

I tried adding a test leg for Ubuntu 24.10 in #110476. It failed due to UCT not being found. I didn't even know what UCT was! I do now, it's just another timezone alias.

This is due to: https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#p-99950-tzdata-package-split

Related:

I propose that we change our tests to only rely on time zones in tzdata. tzdata-legacy seems like an OS compat shim that we have no responsibility to test while we do have a responsibility to validate correct behavior when only tzdata is installed.

This is also evidence that we never integrated 24.04 into our CI. tzdata-legacy is not installed in our test image for that version: https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/98df6254f2637235a711add92d17286e8c44fd59/src/ubuntu/24.04/helix/Dockerfile#L59.

What I observed:

root@142a317ad02d:/# cat /etc/os-release | head -n 1
PRETTY_NAME="Ubuntu 24.10"
root@142a317ad02d:/# apt update && apt install -y tzdata
root@142a317ad02d:/# ls /usr/share/zoneinfo/
Africa      Australia  Etc      MET      WET                tzdata.zi
America     CET        Europe   MST      iso3166.tab        zone.tab
Antarctica  CST6CDT    Factory  MST7MDT  leap-seconds.list  zone1970.tab
Arctic      EET        GMT      PST8PDT  leapseconds        zonenow.tab
Asia        EST        HST      Pacific  localtime
Atlantic    EST5EDT    Indian   UTC      posixrules
root@142a317ad02d:/# apt install -y tzdata-legacy
Installing:                     
  tzdata-legacy
root@142a317ad02d:/# ls /usr/share/zoneinfo/
Africa      Cuba     GMT+0      Kwajalein  Poland     Zulu
America     EET      GMT-0      Libya      Portugal   iso3166.tab
Antarctica  EST      GMT0       MET        ROC        leap-seconds.list
Arctic      EST5EDT  Greenwich  MST        ROK        leapseconds
Asia        Egypt    HST        MST7MDT    Singapore  localtime
Atlantic    Eire     Hongkong   Mexico     Turkey     posixrules
Australia   Etc      Iceland    NZ         UCT        right
Brazil      Europe   Indian     NZ-CHAT    US         tzdata.zi
CET         Factory  Iran       Navajo     UTC        zone.tab
CST6CDT     GB       Israel     PRC        Universal  zone1970.tab
Canada      GB-Eire  Jamaica    PST8PDT    W-SU       zonenow.tab
Chile       GMT      Japan      Pacific    WET
@ghost ghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Dec 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 6, 2024
@teo-tsirpanis teo-tsirpanis added area-System.DateTime and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Dec 6, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-datetime
See info in area-owners.md if you want to be subscribed.

@richlander
Copy link
Member Author

richlander commented Dec 6, 2024

An alternative in the near-term is to install tzdata-legacy. That would be fine.

The whole purpose of testing the non-LTS Ubuntu version is to ensure we're on a good path to support. As a result, this is really a proposal for what we should do for .NET 10+ for Ubuntu 24.04+.

@tarekgh tarekgh added this to the 10.0.0 milestone Dec 6, 2024
@tarekgh tarekgh removed the untriaged New issue has not been triaged by the area owner label Dec 6, 2024
@tarekgh tarekgh self-assigned this Dec 6, 2024
@Clockwork-Muse
Copy link
Contributor

I propose that we change our tests to only rely on time zones in tzdata. tzdata-legacy seems like an OS compat shim that we have no responsibility to test while we do have a responsibility to validate correct behavior when only tzdata is installed.

Alternatively, create a limited set of curated timezone data, and use that instead (or see if there's an existing published test set). Timezone data is brittle and not stable, and we're relying on it to not change. We're quite likely to experience failures in the near term;

  • The US Pacific states have been trying to move off DST for the last several years (in either direction).
  • The EU has approved some changes around how countries are allowed to handle DST, so potential for rules for individual EU countries to change exists.

By using a stable dataset, we can avoid this problem.

@tarekgh
Copy link
Member

tarekgh commented Dec 7, 2024

Alternatively, create a limited set of curated timezone data, and use that instead (or see if there's an existing published test set). Timezone data is brittle and not stable, and we're relying on it to not change. We're quite likely to experience failures in the near term

We need to test with the original distro set. This is better to catch any change that could need some action from the .NET side. We caught some cases before that. Testing with fixed set will not be effective test as it will not catch anything I guess.

@richlander
Copy link
Member Author

richlander commented Dec 7, 2024

I think that our tests should be oriented on finding real customer issues. If we'd been testing Ubuntu 24.04 earlier, we would have found these failures before our users did.

Note, we'll see this same change in Debian next year.

Debian 12:

rich@mazama:~$ docker run --rm -it debian:bookworm ls /usr/share/zoneinfo
Africa	    Cuba     GMT+0	Kwajalein  Poland     Zulu
America     EET      GMT-0	Libya	   Portugal   iso3166.tab
Antarctica  EST      GMT0	MET	   ROC	      leap-seconds.list
Arctic	    EST5EDT  Greenwich	MST	   ROK	      leapseconds
Asia	    Egypt    HST	MST7MDT    Singapore  localtime
Atlantic    Eire     Hongkong	Mexico	   Turkey     posix
Australia   Etc      Iceland	NZ	   UCT	      posixrules
Brazil	    Europe   Indian	NZ-CHAT    US	      right
CET	    Factory  Iran	Navajo	   UTC	      tzdata.zi
CST6CDT     GB	     Israel	PRC	   Universal  zone.tab
Canada	    GB-Eire  Jamaica	PST8PDT    W-SU       zone1970.tab
Chile	    GMT      Japan	Pacific    WET

Debian 13:

rich@mazama:~$ docker run --rm -it debian:trixie ls /usr/share/zoneinfo
Africa	    Asia       Europe	Pacific		   leapseconds	zone.tab
America     Atlantic   Factory	UTC		   localtime	zone1970.tab
Antarctica  Australia  GMT	iso3166.tab	   posixrules	zonenow.tab
Arctic	    Etc        Indian	leap-seconds.list  tzdata.zi

@richlander
Copy link
Member Author

Can we close this @tarekgh?

@tarekgh tarekgh closed this as completed Feb 11, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants