here's an example of the test passing then failing with 2 different dates. ------------------------- vagrant@kohadevbox:~$ sudo date -s 'Sun Jan 29 01:41:55 UTC 2017' Sun Jan 29 01:41:55 GMT 2017 kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/Members/IssueSlip.t t/db_dependent/Members/IssueSlip.t .. ok All tests successful. Files=1, Tests=3, 3 wallclock secs ( 0.03 usr 0.00 sys + 2.10 cusr 0.12 csys = 2.25 CPU) Result: PASS ------------------------- vagrant@kohadevbox:~$ sudo date -s 'Sun Jan 29 00:41:55 UTC 2017' Sun Jan 29 00:41:55 GMT 2017 kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/Members/IssueSlip.t t/db_dependent/Members/IssueSlip.t .. # Looks like you planned 2 tests but ran 1. # Failed test 'Hourly loans' # at t/db_dependent/Members/IssueSlip.t line 279. # Looks like you failed 1 test of 3. t/db_dependent/Members/IssueSlip.t .. 1/3 # Failed test 'Issue slip' # at t/db_dependent/Members/IssueSlip.t line 281. The 'hour' parameter ("-1") to DateTime::set did not pass the 'an integer between 0 and 23' callback at /usr/lib/x86_64-linux-gnu/perl5/5.20/DateTime.pm line 1946. DateTime::set(undef, "hour", -1) called at t/db_dependent/Members/IssueSlip.t line 254 main::__ANON__() called at /usr/local/share/perl/5.20.2/Test/Builder.pm line 309 eval {...} called at /usr/local/share/perl/5.20.2/Test/Builder.pm line 309 Test::Builder::subtest(Test::Builder=HASH(0x1cfa9d0), "Hourly loans", CODE(0x85c7ea0)) called at /usr/local/share/perl/5.20.2/Test/More.pm line 807 Test::More::subtest("Hourly loans", CODE(0x85c7ea0)) called at t/db_dependent/Members/IssueSlip.t line 279 main::__ANON__() called at /usr/local/share/perl/5.20.2/Test/Builder.pm line 309 eval {...} called at /usr/local/share/perl/5.20.2/Test/Builder.pm line 309 Test::Builder::subtest(Test::Builder=HASH(0x1cfa9d0), "Issue slip", CODE(0x86031c8)) called at /usr/local/share/perl/5.20.2/Test/More.pm line 807 Test::More::subtest("Issue slip", CODE(0x86031c8)) called at t/db_dependent/Members/IssueSlip.t line 281 # Looks like your test exited with 255 just after 1. t/db_dependent/Members/IssueSlip.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 3/3 subtests Test Summary Report ------------------- t/db_dependent/Members/IssueSlip.t (Wstat: 65280 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 255 Parse errors: Bad plan. You planned 3 tests but ran 1. Files=1, Tests=1, 2 wallclock secs ( 0.02 usr 0.00 sys + 1.79 cusr 0.08 csys = 1.89 CPU) Result: FAIL -------------------------
Created attachment 59629 [details] [review] Bug 18009 - IssueSlip.t test fails if launched between 00:00 and 00:59 to test patch... 1/ set date between 00:00 and 00:59 $ sudo date -s 'Sun Jan 29 00:41:55 NZDT 2017' 2/ run prove, see fail $ prove -v t/db_dependent/Members/IssueSlip.t ... t/db_dependent/Members/IssueSlip.t (Wstat: 65280 Tests: 1 Failed: 0) Result: FAIL 3/ apply patch 4/ run prove, see pass $ prove -v t/db_dependent/Members/IssueSlip.t ... All tests successful. Result: PASS
Created attachment 59695 [details] [review] Bug 18009 - IssueSlip.t test fails if launched between 00:00 and 00:59 to test patch... 1/ set date between 00:00 and 00:59 $ sudo date -s 'Sun Jan 29 00:41:55 NZDT 2017' 2/ run prove, see fail $ prove -v t/db_dependent/Members/IssueSlip.t ... t/db_dependent/Members/IssueSlip.t (Wstat: 65280 Tests: 1 Failed: 0) Result: FAIL 3/ apply patch 4/ run prove, see pass $ prove -v t/db_dependent/Members/IssueSlip.t ... All tests successful. Result: PASS NOTE: for code obscurity you could have also done a modulus 24. ;) Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 59727 [details] [review] Bug 18009 - IssueSlip.t test fails if launched between 00:00 and 00:59 to test patch... 1/ set date between 00:00 and 00:59 $ sudo date -s 'Sun Jan 29 00:41:55 NZDT 2017' 2/ run prove, see fail $ prove -v t/db_dependent/Members/IssueSlip.t ... t/db_dependent/Members/IssueSlip.t (Wstat: 65280 Tests: 1 Failed: 0) Result: FAIL 3/ apply patch 4/ run prove, see pass $ prove -v t/db_dependent/Members/IssueSlip.t ... All tests successful. Result: PASS NOTE: for code obscurity you could have also done a modulus 24. ;) Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Pushed to master for 17.05, thanks Mason!
This patch has been pushed to 16.11.x and will be in 16.11.04.
Pushed to 3.22.x for 3.22.17