Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/test/test-time-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;

Expand Down
Loading