On Sun, Jan 02, 2022 at 12:17:31AM -0500, Laine Stump wrote:
On 1/1/22 2:07 PM, Andrea Bolognani wrote:
> tests: virtimetest: Skip more tests near year's end
Ugh, I had managed to repress the memories of this, and now it's come back
:-O
Same :)
*if* you can explain to me why (at 11:55PM local time on Jan 1) all
28 of
virtimetest cases were run by "ninja -C build test", with test 27 & 28
failing, *but* when I just ran build/tests/virtimetest directly, it
succeeded - running it under gdb I found that isNearYearEnd() properly
returned true, so the final 8 tests aren't run (as you would expect).
Not only that, but when I ran "ninja -C build test" at 12:01AM Jan 2, test
28 failed; it also failed when I directly ran virtimetest.
For the first problem - is it possible that ninja is setting the timezone to
something different during the build? My machine is in EST (UTC -5).
I don't think that's the case: I hacked virtimetest to print out the
timezone, and I get the same output whether I run it through 'meson
test' (or 'ninja test') or as a standalone program.
While doing so, I also realized something that should probably have
been obvious: since each call to TEST_LOCALOFFSET() sets the TZ
environment variable and invokes tzset(), depending on where in the
test program it is called isNearYearEnd() might return a different
result.
So perhaps we should call isNearYearEnd() once, before the first call
to TEST_LOCALOFFSET(), and use that result to decide which tests to
skip?
Honestly I'm still unclear on the interactions between the data we're
testing and the local timezone of the machine we're running tests on.
I basically shamelessly cargo-culted the existing approach :)
--
Andrea Bolognani / Red Hat / Virtualization