Issue 9488 - std.datetime unittest failure
Summary: std.datetime unittest failure
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-09 03:01 UTC by yazan.dabain
Modified: 2019-11-20 14:28 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description yazan.dabain 2013-02-09 03:01:01 UTC
Running the phobos unittests, a failure in std.datetime line 1501 was reported. Local timezone is Asia/Amman. Changing the timezone makes the test pass.
Running on Fedora 18.

core.exception.AssertError@std/datetime.d(1501): [1999-Jul-31 01:00:00] [1999-Jul-31 00:00:00]
----------------
generated/linux/debug/64/unittest/std/datetime(onUnittestErrorMsg+0x46) [0x877132]
generated/linux/debug/64/unittest/std/datetime(_d_unittest_msg+0x45) [0x86a72d]
generated/linux/debug/64/unittest/std/datetime(void std.datetime.SysTime.__unittestL1466_27()+0x1320) [0x5b8854]
generated/linux/debug/64/unittest/std/datetime(void std.datetime.__modtest()+0x81) [0x864615]
generated/linux/debug/64/unittest/std/datetime(extern (C) bool core.runtime.runModuleUnitTests().int __foreachbody327(ref object.ModuleInfo*)+0x30) [0x87745c]
generated/linux/debug/64/unittest/std/datetime(int rt.minfo.moduleinfos_apply(scope int delegate(ref object.ModuleInfo*))+0x55) [0x86f265]
generated/linux/debug/64/unittest/std/datetime(runModuleUnitTests+0xae) [0x8772f6]
generated/linux/debug/64/unittest/std/datetime(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void runAll()+0x22) [0x86ae5a]
generated/linux/debug/64/unittest/std/datetime(extern (C) int rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).void tryExec(scope void delegate())+0x2a) [0x86a96a]
generated/linux/debug/64/unittest/std/datetime(_d_run_main+0x1a8) [0x86a924]
generated/linux/debug/64/unittest/std/datetime(main+0x17) [0x86a777]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x3e8f221a05]
make[1]: *** [generated/linux/debug/64/unittest/std/datetime] Error 1
make: *** [unittest] Error 2
Comment 1 Jonathan M Davis 2013-02-09 17:14:11 UTC
I very much doubt that there's any real bug here (tests like this are notoriously hard to write in a way that works across all time zones), but I'll try and find time to look into it.
Comment 2 Jonathan M Davis 2013-02-09 17:43:06 UTC
It looks like the problem is the fact that Asia/Amman had a DST switch on July 1st, 1999. I didn't think that anyone had DST switches in July. They're always in Spring or Fall. Yuck. Okay. It's definitely not a bug in std.datetime itself. It'll work fine. It's a bug in the tests. I'll have to figure out how to fix them that works across more (preferably all) time zones.
Comment 3 yazan.dabain 2013-02-11 06:53:13 UTC
I thought so too, but I wanted to make sure that it wasn't some edge case or something.

(btw, we need to find a way to enable running the rest of the unit-tests even if one fails. But that's an issue for another ticket)

Thanks for you efforts.
Comment 4 berni44 2019-11-19 18:18:20 UTC
For reference: The broken assertion moved meanwhile to systime.d, line 1464. Nothing has changed there and I doubt, that this will be fixed.
Comment 5 Parmigiano2 2019-11-19 18:35:09 UTC
Nope.

*** This issue has been marked as a duplicate of issue 19116 ***
Comment 6 Vladimir Panteleev 2019-11-20 14:28:50 UTC
Undoing vandalism(?) by Parmigiano