Skip to content

Conversation

@itingliu
Copy link
Contributor

We saw a test failure in this CI job: https://ci.swift.org/job/oss-swift-6.2-bootstrap-ubuntu-24_04-x86_64/318

[2025-10-26T00:58:39.054Z] ✘ Test localizedName_103036605() recorded an issue at TimeZoneTests.swift:74:13: Expectation failed: (tz?.localizedName(for: .generic, locale: locale) → "Central European Time (Germany)") == (expected → "Central European Time")

The cause of this test failure is that this TimeZone API uses the current time as reference, and depending on style it may include the time zone city to disambiguate that from the golden zone if the current time is close to a DST transition.

Update the test to use the golden zone to opt out of this unexpected behavior since that is not what this test was meant to test.

Also while we're here, update the test to respect the style argument.

…hange

We saw a test failure in this CI job: https://ci.swift.org/job/oss-swift-6.2-bootstrap-ubuntu-24_04-x86_64/318

```
[2025-10-26T00:58:39.054Z] ✘ Test localizedName_103036605() recorded an issue at TimeZoneTests.swift:74:13: Expectation failed: (tz?.localizedName(for: .generic, locale: locale) → "Central European Time (Germany)") == (expected → "Central European Time")
```

The cause of this test failure is that this `TimeZone` API uses the current time as reference, and depending on `style` it may include the time zone city to disambiguate that from the [golden zone](https://www.unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names) if the current time is close to a DST transition.

Update the test to use the golden zone to opt out of this unexpected behavior since that is not what this test was meant to test.

Also while we're here, update the test to respect the `style` argument.
@itingliu
Copy link
Contributor Author

@swift-ci PLEASE TEST

@itingliu itingliu marked this pull request as draft October 28, 2025 18:29
@itingliu
Copy link
Contributor Author

Test failures are legitimate. Putting this back to draft

@itingliu
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@itingliu
Copy link
Contributor Author

@swift-ci please test

@itingliu itingliu marked this pull request as ready for review October 28, 2025 23:04
@itingliu
Copy link
Contributor Author

@swift-ci please test

@itingliu itingliu merged commit 7242fa9 into swiftlang:release/6.2 Oct 31, 2025
21 checks passed
@itingliu itingliu deleted the 6.2-timezone-test branch October 31, 2025 16:51
The time zone offset for Vostok recently went through a change. Udpate the test to use a stable time zone for this test
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