Bug 22917 - Circulation.t fails if tests are ran slowly Not fixed, or regression added after.
Created attachment 100778 [details] [review] Bug 24881: [19.05.x] Try to fix random failure from Circulation.t
Lucas, if you can recreate that one, could you confirm this patch fixes the failures on 19.05?
Jonathan, I still get this: # Subtest: CanBookBeRenewed tests 1..71 DBD::mysql::st execute failed: Unknown column 'me.guarantorid' in 'field list' [for Statement "SELECT `me`.`borrowernumber`, `me`.`cardnumber`, `me`.`surname`, `me`.`firstname`, `me`.`title`, `me`.`othernames`, `me`.`initials`, `me`.`streetnumber`, `me`.`streettype`, `me`.`address`, `me`.`address2`, `me`.`city`, `me`.`state`, `me`.`zipcode`, `me`.`country`, `me`.`email`, `me`.`phone`, `me`.`mobile`, `me`.`fax`, `me`.`emailpro`, `me`.`phonepro`, `me`.`B_streetnumber`, `me`.`B_streettype`, `me`.`B_address`, `me`.`B_address2`, `me`.`B_city`, `me`.`B_state`, `me`.`B_zipcode`, `me`.`B_country`, `me`.`B_email`, `me`.`B_phone`, `me`.`dateofbirth`, `me`.`branchcode`, `me`.`categorycode`, `me`.`dateenrolled`, `me`.`dateexpiry`, `me`.`date_renewed`, `me`.`gonenoaddress`, `me`.`lost`, `me`.`debarred`, `me`.`debarredcomment`, `me`.`contactname`, `me`.`contactfirstname`, `me`.`contacttitle`, `me`.`guarantorid`, `me`.`borrowernotes`, `me`.`relationship`, `me`.`sex`, `me`.`password`, `me`.`flags`, `me`.`userid`, `me`.`opacnote`, `me`.`contactnote`, `me`.`sort1`, `me`.`sort2`, `me`.`altcontactfirstname`, `me`.`altcontactsurname`, `me`.`altcontactaddress1`, `me`.`altcontactaddress2`, `me`.`altcontactaddress3`, `me`.`altcontactstate`, `me`.`altcontactzipcode`, `me`.`altcontactcountry`, `me`.`altcontactphone`, `me`.`smsalertnumber`, `me`.`sms_provider_id`, `me`.`privacy`, `me`.`privacy_guarantor_checkouts`, `me`.`checkprevcheckout`, `me`.`updated_on`, `me`.`lastseen`, `me`.`lang`, `me`.`login_attempts`, `me`.`overdrive_auth_token`, `me`.`anonymized` FROM `borrowers` `me` WHERE ( `me`.`borrowernumber` = ? )" with ParamValues: 0='84'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. # No tests run! not ok 15 - No tests run for subtest "CanBookBeRenewed tests" # Failed test 'No tests run for subtest "CanBookBeRenewed tests"' # at /kohadevbox/koha/t/db_dependent/Circulation.t line 998. DBD::mysql::st execute failed: Unknown column 'me.guarantorid' in 'field list' [for Statement "SELECT `me`.`borrowernumber`, `me`.`cardnumber`, `me`.`surname`, `me`.`firstname`, `me`.`title`, `me`.`othernames`, `me`.`initials`, `me`.`streetnumber`, `me`.`streettype`, `me`.`address`, `me`.`address2`, `me`.`city`, `me`.`state`, `me`.`zipcode`, `me`.`country`, `me`.`email`, `me`.`phone`, `me`.`mobile`, `me`.`fax`, `me`.`emailpro`, `me`.`phonepro`, `me`.`B_streetnumber`, `me`.`B_streettype`, `me`.`B_address`, `me`.`B_address2`, `me`.`B_city`, `me`.`B_state`, `me`.`B_zipcode`, `me`.`B_country`, `me`.`B_email`, `me`.`B_phone`, `me`.`dateofbirth`, `me`.`branchcode`, `me`.`categorycode`, `me`.`dateenrolled`, `me`.`dateexpiry`, `me`.`date_renewed`, `me`.`gonenoaddress`, `me`.`lost`, `me`.`debarred`, `me`.`debarredcomment`, `me`.`contactname`, `me`.`contactfirstname`, `me`.`contacttitle`, `me`.`guarantorid`, `me`.`borrowernotes`, `me`.`relationship`, `me`.`sex`, `me`.`password`, `me`.`flags`, `me`.`userid`, `me`.`opacnote`, `me`.`contactnote`, `me`.`sort1`, `me`.`sort2`, `me`.`altcontactfirstname`, `me`.`altcontactsurname`, `me`.`altcontactaddress1`, `me`.`altcontactaddress2`, `me`.`altcontactaddress3`, `me`.`altcontactstate`, `me`.`altcontactzipcode`, `me`.`altcontactcountry`, `me`.`altcontactphone`, `me`.`smsalertnumber`, `me`.`sms_provider_id`, `me`.`privacy`, `me`.`privacy_guarantor_checkouts`, `me`.`checkprevcheckout`, `me`.`updated_on`, `me`.`lastseen`, `me`.`lang`, `me`.`login_attempts`, `me`.`overdrive_auth_token`, `me`.`anonymized` FROM `borrowers` `me` WHERE ( `me`.`borrowernumber` = ? )" with ParamValues: 0='84'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. # Looks like your test exited with 11 just after 15. Dubious, test returned 11 (wstat 2816, 0xb00) Failed 32/46 subtests
Lucas, this means that you are using a master DB on a 19.05.x branch. reset_all on 19.05.x and you should not get that error.
ahh, of course. Thanks Jonathan.
backported to 19.05.x for 19.05.09
(In reply to Lucas Gass from comment #6) > backported to 19.05.x for 19.05.09 Can you confirm this patch did fix something? Which error did you get?
Jonathan, no errors. This makes Circulation.t pass all tests. TY.
(In reply to Lucas Gass from comment #8) > Jonathan, no errors. This makes Circulation.t pass all tests. TY. I do not understand what happened here. What are the failing tests this patch fixed? It's not supposed to fix the failures you reported on comment 3. If other tests are fixed we need to have the patch into master as well.
Sorry Jonathan, It fixes Circulation.t tests for me, the problems in comment 3 were my own problem. I wrongly assumed this one was for [19.05.x] only so I pushed to that branch. I will revert.
I forgot if this test was really failing. Holding on for now, until it reappears.
Created attachment 100970 [details] [review] Bug 24881: Try to fix random failure from Circulation.t This is a follow-up of bug 22917.
Sending to RM queue.
Nice work everyone! Pushed to master for 20.05
does not apply to 19.11.x. not backported. please rebase if needed.
Created attachment 105169 [details] [review] Bug 24881: [19.11.x] Try to fix random failure from Circulation.t This is a follow-up of bug 22917.
Pushed to 19.11.x for 19.11.06
Info: patch of comment 1 is still in 19.05.x and isn't not the cause of bug 25665 (test t/db_dependent/Circulation.t fails on a specific date)
On the CI of branch 19.05 I've had 3 failures on this test (can't replicate locally) koha_1 | # Failed test 'Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays (168h - 24h * 0.25u)' koha_1 | # at t/db_dependent/Circulation.t line 3245. koha_1 | # got: '30' koha_1 | # expected: '36' koha_1 | # Looks like you failed 1 test of 20. koha_1 | koha_1 | # Failed test 'Incremented fee tests' koha_1 | # at t/db_dependent/Circulation.t line 3270. https://jenkins.koha-community.org/view/19.05/job/Koha_19.05_D8/234/consoleText https://jenkins.koha-community.org/view/19.05/job/Koha_19.05_D9/228/consoleText https://jenkins.koha-community.org/view/19.05/job/Koha_19.05_U18/229/consoleText Does this look related to this bug? It seems to not affect 19.11, 20.05 and master after looking at all the test failure since almost 3 weeks in these branches. Which is why it might be related to this ticket. As 19.05 seems to be a bit different in regard to was happened in this ticket.
Locally I can have the following two possible errors. (confirmed only on 19.05.x) Patch from comment 1 (which in 19.05) doesn't seem to have an impact when kept or reverted. t/db_dependent/Circulation.t .. 29/46 # Failed test 'ISSUED_TO_ANOTHER question flag should be set if AutoReturnCheckedOutItems is disabled and item is checked out to another' # at t/db_dependent/Circulation.t line 1974. # got: undef # expected: '1' # Looks like you planned 2 tests but ran 1. # Looks like you failed 1 test of 1 run. t/db_dependent/Circulation.t .. 30/46 # Failed test 'CanBookBeIssued + AutoReturnCheckedOutItems' # at t/db_dependent/Circulation.t line 1981. Can't call method "borrowernumber" on an undefined value at t/db_dependent/Circulation.t line 1978. # Looks like your test exited with 255 just after 30. ##### And also ##### t/db_dependent/Circulation.t .. 28/46 # Failed test 'AddReturn must have debarred the patron' # at t/db_dependent/Circulation.t line 86. # got: '' # expected: '1' # AddReturn returned message $VAR1 = { # 'WasReturned' => 1 # }; # Failed test 'Test at line 1924' # at t/db_dependent/Circulation.t line 90. # got: '0' # expected: '1' # Failed test 'Test at line 1924' # at t/db_dependent/Circulation.t line 93. # got: undef # expected: '2020-06-22' # Looks like you failed 3 tests of 21. t/db_dependent/Circulation.t .. 29/46 # Failed test 'AddReturn + suspension_chargeperiod' # at t/db_dependent/Circulation.t line 1933.
Created attachment 105721 [details] [review] Bug 24881: [19.05.x] Try to fix random failure from Circulation.t This is a follow-up of bug 22917. Signed-off-by: Joy Nelson <joy@bywatersolutions.com> (cherry picked from commit b0551cfd178565b5b30980096f53d4fffcfca454)
(In reply to Jonathan Druart from comment #21) > Created attachment 105721 [details] [review] [review] > Bug 24881: [19.05.x] Try to fix random failure from Circulation.t > > This is a follow-up of bug 22917. > > Signed-off-by: Joy Nelson <joy@bywatersolutions.com> > (cherry picked from commit b0551cfd178565b5b30980096f53d4fffcfca454) Victor, this is a rebased patch of the 19.11.x version.
I can still get the following error locally. I confirm that have applied the patch of comment 21 on top of 19.05.x without reverting the old patch t/db_dependent/Circulation.t .. 29/46 # Failed test 'ISSUED_TO_ANOTHER question flag should be set if AutoReturnCheckedOutItems is disabled and item is checked out to another' # at t/db_dependent/Circulation.t line 1975. # got: undef # expected: '1' # Looks like you planned 2 tests but ran 1. t/db_dependent/Circulation.t .. 30/46 # Looks like you failed 1 test of 1 run. # Failed test 'CanBookBeIssued + AutoReturnCheckedOutItems' # at t/db_dependent/Circulation.t line 1982. Can't call method "borrowernumber" on an undefined value at t/db_dependent/Circulation.t line 1979. # Looks like your test exited with 255 just after 30. t/db_dependent/Circulation.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Should I push the patch of comment 21 anyway? If we still expect to fix part of the flaky tests.
(In reply to Victor Grousset/tuxayo from comment #23) > I can still get the following error locally. > I confirm that have applied the patch of comment 21 on top of 19.05.x > without reverting the old patch > > > t/db_dependent/Circulation.t .. 29/46 > # Failed test 'ISSUED_TO_ANOTHER question flag should be set if > AutoReturnCheckedOutItems is disabled and item is checked out to another' > # at t/db_dependent/Circulation.t line 1975. > # got: undef > # expected: '1' > # Looks like you planned 2 tests but ran 1. > t/db_dependent/Circulation.t .. 30/46 # Looks like you failed 1 test of > 1 run. > > # Failed test 'CanBookBeIssued + AutoReturnCheckedOutItems' > # at t/db_dependent/Circulation.t line 1982. > Can't call method "borrowernumber" on an undefined value at > t/db_dependent/Circulation.t line 1979. > # Looks like your test exited with 255 just after 30. > t/db_dependent/Circulation.t .. Dubious, test returned 255 (wstat 65280, > 0xff00) This is because 19.05 is lacking: Bug 24062: Make sure TestBuilder will stop generate X or other invalid category's types
Great find, will try that.
Backported to 19.05.x branch for 19.05.12