[phobos] Phobos datetime unittests fail on German Windows 7

Jonathan M Davis jmdavisProg at gmx.com
Fri Sep 30 23:51:17 PDT 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


More information about the phobos mailing list