From 47d70d3a1b858b26788b365572b487ccb999b0fc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 5 Jan 2026 16:01:34 +0900 Subject: [PATCH] test-time-util: ignore failure on MSK timezone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore the following failures: - with glibc ``` TZ=Europe/Volgograd, tzname[0]=MSK, tzname[1]=MSD @1414277092997572 → Sun 2014-10-26 01:44:52 MSK → @1414273492000000 → Sun 2014-10-26 01:44:52 MSK src/test/test-time-util.c:448: Assertion failed: Expected "ignore" to be true ``` - with musl ``` TZ=Europe/Kirov, tzname[0]=MSK, tzname[1]=MSK @1414277092997572 → Sun 2014-10-26 01:44:52 MSK → @1414273492000000 → Sun 2014-10-26 01:44:52 MSK src/test/test-time-util.c:448: Assertion failed: Expected "ignore" to be true ``` --- src/test/test-time-util.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c index c56282781d..d5d4992f82 100644 --- a/src/test/test-time-util.c +++ b/src/test/test-time-util.c @@ -433,11 +433,13 @@ static void test_format_timestamp_impl(usec_t x) { if (x_sec == y_sec && streq(xx, yy)) return; /* Yay! */ - /* When the timezone is built with rearguard being enabled (e.g. old Ubuntu and RHEL), the following - * timezone may provide time shifted 1 hour from the original. See - * https://github.com/systemd/systemd/issues/28472 and https://github.com/systemd/systemd/pull/35471 */ + /* When the timezone is built with rearguard being enabled (e.g. old Ubuntu and RHEL), the timezone + * Africa/Windhoek may provide time shifted 1 hour from the original. See + * https://github.com/systemd/systemd/issues/28472 and https://github.com/systemd/systemd/pull/35471. + * Also, the same may happen on MSK timezone (e.g. Europe/Volgograd or Europe/Kirov). */ bool ignore = - streq_ptr(getenv("TZ"), "Africa/Windhoek") && + (streq_ptr(getenv("TZ"), "Africa/Windhoek") || + streq_ptr(get_tzname(/* dst= */ false), "MSK")) && (x_sec > y_sec ? x_sec - y_sec : y_sec - x_sec) == 3600; log_full(ignore ? LOG_WARNING : LOG_ERR, @@ -459,6 +461,9 @@ static void test_format_timestamp_loop(void) { test_format_timestamp_impl(1504938962980066); test_format_timestamp_impl(1509482094632752); + /* With tzdata-2025c, the timestamp (randomly?) fails on MSK time zone (e.g. Europe/Volgograd). */ + test_format_timestamp_impl(1414277092997572); + for (unsigned i = 0; i < TRIAL; i++) { usec_t x;