Thread overview
[phobos] Phobos datetime unittests fail on German Windows 7
Oct 01, 2011
Don Clugston
Oct 01, 2011
kenji hara
Oct 01, 2011
Jonathan M Davis
Oct 01, 2011
Jonathan M Davis
October 01, 2011
unittest
totalCPUs = 4
[]Failed time zone: America/Los_Angeles
core.exception.AssertError at std\datetime.d(27754): _assertPred!"=="
failed: [Pacific Normalzeit] is not == [Pacific Standard Time].

Seems as though it assumes that OS time zone names are in English. I also notice that some recent change to Phobos tests (possibly this one) makes them take about 4X as long to run. (compilation time is a bit slower as well, but I'm talking about the run time).
October 01, 2011
2011/10/1 Don Clugston <dclugston at googlemail.com>:
> unittest
> totalCPUs = 4
> []Failed time zone: America/Los_Angeles
> core.exception.AssertError at std\datetime.d(27754): _assertPred!"=="
> failed: [Pacific Normalzeit] is not == [Pacific Standard Time].
>
> Seems as though it assumes that OS time zone names are in English. I also notice that some recent change to Phobos tests (possibly this one) makes them take about 4X as long to run. (compilation time is a bit slower as well, but I'm talking about the run time).

With Japanese localization, the things are worse.
The OS time zone names are provided with Japanese language, then
invalid-UTF error is raised.

I already posted pull request to fix it. https://github.com/D-Programming-Language/phobos/pull/276 https://github.com/D-Programming-Language/phobos/pull/280

(#276 causes circular dependency error in unit testing, then #280 is
need to fix it.)

If you have the time, please review them.

Kenji Hara
September 30, 2011
On Saturday, October 01, 2011 08:36:44 Don Clugston wrote:
> unittest
> totalCPUs = 4
> []Failed time zone: America/Los_Angeles
> core.exception.AssertError at std\datetime.d(27754): _assertPred!"=="
> failed: [Pacific Normalzeit] is not == [Pacific Standard Time].
> 
> Seems as though it assumes that OS time zone names are in English. I also notice that some recent change to Phobos tests (possibly this one) makes them take about 4X as long to run. (compilation time is a bit slower as well, but I'm talking about the run time).

In order to verify the DST stuff, it's reading in more time zone files than before, so that's probably the main reason for the slowdown (though changes in the compiler may have made it worse too, given that on Windows at least, that's become worse of late). As I rewrite the tests though (as has been previously requested and I've slowly been doing), the situation is likely to get worse - which is why I was already considering adding some sort of versioning to std.datetime for some of the tests when you suggested doing it globally in Phobos. But this particular case is probably because of the time zone files being read in. I'm not sure how expensive reading a time zone file in actually is, but it obviously involves I/O, which is generally expensive, and a fair number of calculations are needed to arrange the information that's in the file so that it's usable, so I'm sure that reading in a time zone file is not cheap. Unfortunately, I don't really have a way to fix that other than reducing test coverage.

To fully test the stuff, I do need to verify that the time zone names are being read correctly, but if that varies from locale to locale, then obviously that's not going to work as-is. I may add something to check whether the locale is US English and just check then, but for now I should probably just comment those particular tests out. I believe that Kenji has a pull request that does the same on Windows for the same reason.

- Jonathan M Davis
October 01, 2011
On Saturday, October 01, 2011 08:36:44 Don Clugston wrote:
> unittest
> totalCPUs = 4
> []Failed time zone: America/Los_Angeles
> core.exception.AssertError at std\datetime.d(27754): _assertPred!"=="
> failed: [Pacific Normalzeit] is not == [Pacific Standard Time].
> 
> Seems as though it assumes that OS time zone names are in English. I also notice that some recent change to Phobos tests (possibly this one) makes them take about 4X as long to run. (compilation time is a bit slower as well, but I'm talking about the run time).

I just disabled the tests for stdName and dstName on Posix, which should fix the locale-dependent failures on Posix. Kenji's pull request should fix those issues on Windows.

- Jonathan M Davis