https://jenkins.koha-community.org/job/Koha_18.05_D9/lastCompletedBuild/consoleFull koha_1 | # Failed test 'The date_due should have been set depending on the circ rules when the on-site checkout has been switched' koha_1 | # at t/db_dependent/Circulation/SwitchOnSiteCheckouts.t line 122. koha_1 | # got: '2018-08-03T23:59:00' koha_1 | # expected: '2018-08-08T23:59:00' koha_1 | # Looks like you failed 1 test of 10. koha_1 | [13:48:23] t/db_dependent/Circulation/SwitchOnSiteCheckouts.t koha_1 | Dubious, test returned 1 (wstat 256, 0x100) koha_1 | Failed 1/10 subtests
https://jenkins.koha-community.org/job/Koha_18.05_D8/lastCompletedBuild/consoleFull koha_1 | # Failed test 'The date_due should have been set depending on the circ rules when the on-site checkout has been switched' koha_1 | # at t/db_dependent/Circulation/SwitchOnSiteCheckouts.t line 122. koha_1 | # got: '2018-10-16T23:59:00' koha_1 | # expected: '2018-10-21T23:59:00' koha_1 | # Looks like you failed 1 test of 10. koha_1 | [12:17:48] t/db_dependent/Circulation/SwitchOnSiteCheckouts.t
Created attachment 80652 [details] [review] Bug 21155: Prevent SwitchOnSiteCheckouts.t to fail randomly # Failed test 'The date_due should have been set depending on the circ rules when the on-site checkout has been switched' # at t/db_dependent/Circulation/SwitchOnSiteCheckouts.t line 126. # got: '2018-10-16T23:59:00' # expected: '2018-10-21T23:59:00' TestBuilder set date to today, so issuingrules.harduedate will be set to today. issuingrules.hardduedatecompare will be set to an integer. If set to 0, $datedue will be reset to the hard due date The call stack is: AddIssue > CalcDateDue > GetHardDueDate In GetHardDueDate: 3509 if ( $hardduedatecompare == 0 || $hardduedatecompare == $cmp ) { 3510 $datedue = $hardduedate->clone; 3511 } To fix this random failure we need to set issuingrules.harduedate to undef. Test plan: 0. Do not apply this patch 1. Modify the test to set hardduedatecompare to 0 (search 'my $issuingrule = ') 2. Execute the test and confirm the failure 3. Apply this patch 4. Execute the test and confirm the it is no longer failing
Created attachment 80653 [details] [review] Bug 21155: Prevent SwitchOnSiteCheckouts.t to fail randomly # Failed test 'The date_due should have been set depending on the circ rules when the on-site checkout has been switched' # at t/db_dependent/Circulation/SwitchOnSiteCheckouts.t line 126. # got: '2018-10-16T23:59:00' # expected: '2018-10-21T23:59:00' TestBuilder set date to today, so issuingrules.harduedate will be set to today. issuingrules.hardduedatecompare will be set to an integer. If set to 0, $datedue will be reset to the hard due date The call stack is: AddIssue > CalcDateDue > GetHardDueDate In GetHardDueDate: 3509 if ( $hardduedatecompare == 0 || $hardduedatecompare == $cmp ) { 3510 $datedue = $hardduedate->clone; 3511 } To fix this random failure we need to set issuingrules.harduedate to undef. Test plan: 0. Do not apply this patch 1. Modify the test to set hardduedatecompare to 0 (search 'my $issuingrule = ') 2. Execute the test and confirm the failure 3. Apply this patch 4. Execute the test and confirm the it is no longer failing Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Well sleuthed Jonathan. Going straight to Passed QA for this; Works as expected and keeps Jenkins happy.. it's always good to appease the mighty Jenkins!
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.06
Pushed to 17.11.x for 17.11.12