Skip to content

Commit 61bc216

Browse files
committed
MDEV-38029 my_tzinfo-t fails for certain TZ values on musl
The test fails for TZ values such as `PST8PDT` (present but outdated in tzdb) and custom forms like `GST-1GDT`. On musl, these values do not trigger the expected DST transitions, leading to incorrect DST offsets or abbreviations. This appears to be a musl libc bug; the same TZ values behave correctly elsewhere, including Windows. We work around it by skipping the affected tests when musl is detected.
1 parent 7a1ad32 commit 61bc216

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

unittest/mysys/my_tzinfo-t.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,20 @@ void test_timezone(const char *tz_env, const char **expected_tznames,
112112
}
113113
}
114114
ok(found, "%s: timezone_name = %s", tz_env, timezone_name);
115+
116+
#if defined __linux__ && !defined __GLIBC__ && !defined __UCLIBC__
117+
/*
118+
MUSL incorrectly calculates UTC offsets and abbreviations
119+
for certain values of TZ (DST related). See MDEV-38029
120+
Skip tests in this case.
121+
*/
122+
if (!strcmp(tz_env, "PST8PDT") || !strcmp(tz_env, "GST-1GDT"))
123+
{
124+
skip(6, "musl UTC offset/abbreviation bug, tzname %s, see MDEV-38029", tz_env);
125+
return;
126+
}
127+
#endif
128+
115129
my_tzinfo(SUMMER_TIMESTAMP, &tz);
116130
ok(summer_gmt_off == tz.seconds_offset, "%s: Summer GMT offset %ld", tz_env, tz.seconds_offset);
117131
check_utc_offset(SUMMER_TIMESTAMP,tz.seconds_offset, tz_env);

0 commit comments

Comments
 (0)