Closed JDGrimes closed 7 years ago
There was 1 failure:
1) WordPoints_Hook_Extension_Periods_Test::test_should_hit_absolute_gmt_offset with data set "+0" (0)
Failed asserting that actual size 1 matches expected size 2.
/home/travis/build/WordPoints/wordpoints/tests/phpunit/tests/classes/hook/extension/periods.php:742
Also:
There was 1 failure:
1) WordPoints_Hook_Extension_Periods_Test::test_should_hit_absolute_gmt_offset with data set #-5 (-5)
Failed asserting that actual size 1 matches expected size 2.
/home/travis/build/WordPoints/wordpoints/tests/phpunit/tests/classes/hook/extension/periods.php:742
/home/travis/.phpenv/versions/5.2.17/bin/phpunit:46
I thought that this might possibly have been related to #505, but I don't think that it was (or at least not all of the failures were, because some are still happening). I have not experienced one of these locally as well, but it is not reproducible, because it is time related. I guess we'll have to really dig into the logic to figure out exactly what is going on.
Looks like that fixed it. I keep forgetting that the periods use greater than instead of greater than or equals.
Just discovered another one:
There was 1 failure:
1) WordPoints_Points_Hook_Extension_Legacy_Periods_Test::test_should_hit_target_changed
Failed asserting that actual size 2 matches expected size 1.
/home/travis/build/WordPoints/wordpoints/tests/phpunit/tests/classes/hook/extension/periods.php:871
Some of these can fail randomly because the use a length of only a minute, and the periods are absolute. Therefore if the test occurs during the end of a minute, the period will end, and failure will result. The solution is to use a longer period, and/or make them relative instead of absolute. I think that using a period of one day would be sufficient, event though the absolute nature of the periods isn't integral to these particular tests.
See this build:
This is probably related to time calculations in the tests sometimes not being quite right for some reason.