Bug 19696

Summary: HoldsQueue.t is failing randomly
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Chris Cormack <chris>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: kyle
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 25551    

Description Jonathan Druart 2017-11-27 12:30:27 UTC
https://jenkins.koha-community.org/job/Koha_Master_D8/294/console

#   Failed test 'Holds queue filling 1st correct hold for default holds policy 'from home library''
#   at t/db_dependent/HoldsQueue.t line 295.
#          got: 'ig5lWyedNiY9jjrOLHEZQMJ'
#     expected: 'b_8YX7Q_M7PjVyGxX9BsaKf'

#   Failed test 'Holds queue filling 2nd correct hold for default holds policy 'from home library''
#   at t/db_dependent/HoldsQueue.t line 296.
#          got: 'b_8YX7Q_M7PjVyGxX9BsaKf'
#     expected: 'ig5lWyedNiY9jjrOLHEZQMJ'
# Looks like you failed 2 tests of 44.
[19:04:35] t/db_dependent/HoldsQueue.t .................................... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/44 subtests
Comment 1 Jonathan Druart 2017-12-19 15:06:26 UTC
https://jenkins.koha-community.org/job/Koha_Master_D8/315/console

#   Failed test 'Holds queue filling 1st correct hold for default holds policy 'from home library''
#   at t/db_dependent/HoldsQueue.t line 295.
#          got: 'slgPPCeZVUsCvZL82wjWw'
#     expected: 'NAS1Ol9956P9q385FaDGw8OT'

#   Failed test 'Holds queue filling 2nd correct hold for default holds policy 'from home library''
#   at t/db_dependent/HoldsQueue.t line 296.
#          got: 'NAS1Ol9956P9q385FaDGw8OT'
#     expected: 'slgPPCeZVUsCvZL82wjWw'
# Looks like you failed 2 tests of 44.
[14:20:45] t/db_dependent/HoldsQueue.t
Comment 2 Jonathan Druart 2018-01-09 13:35:00 UTC
https://jenkins.koha-community.org/job/Koha_Master_D8/329/console

#   Failed test 'Holds queue filling 1st correct hold for default holds policy 'from home library''
#   at t/db_dependent/HoldsQueue.t line 295.
#          got: 'q1ZyoBV1Rhutm9IoDlYbsJ6'
#     expected: 'voiWWxpt0eRUZNR2asguksbNxwjxlt'

#   Failed test 'Holds queue filling 2nd correct hold for default holds policy 'from home library''
#   at t/db_dependent/HoldsQueue.t line 296.
#          got: 'voiWWxpt0eRUZNR2asguksbNxwjxlt'
#     expected: 'q1ZyoBV1Rhutm9IoDlYbsJ6'
# Looks like you failed 2 tests of 44.
[13:07:51] t/db_dependent/HoldsQueue.t
Comment 3 Jonathan Druart 2020-11-20 11:28:45 UTC
Koha_Master_U20/155
Comment 4 Jonathan Druart 2020-11-20 11:47:38 UTC
Kyle, do you have any ideas why we are sorting by itemnumber?

C4/HoldsQueue.pm

in sub CreatePicklistFromItemMap
690     foreach my $itemnumber  (sort keys %$item_map) {


It may be the cause of the problem here.
Comment 5 Jonathan Druart 2021-07-13 09:05:52 UTC
Koha_Master/1705
Comment 6 Jonathan Druart 2021-10-21 12:54:07 UTC
Master_D9/1794

14:17:30 koha_1       | #   Failed test 'Holds queue filling 1st correct hold for default holds policy 'from home library''
14:17:30 koha_1       | #   at t/db_dependent/HoldsQueue.t line 320.
14:17:30 koha_1       | #          got: 'iD4VfHjwsDLsME6EmcuxZiMP68K'
14:17:30 koha_1       | #     expected: 'HD2wJXQTPPS2Xg3FCWzu'
14:17:30 koha_1       | 
14:17:30 koha_1       | #   Failed test 'Holds queue filling 2nd correct hold for default holds policy 'from home library''
14:17:30 koha_1       | #   at t/db_dependent/HoldsQueue.t line 321.
14:17:30 koha_1       | #          got: 'HD2wJXQTPPS2Xg3FCWzu'
14:17:30 koha_1       | #     expected: 'iD4VfHjwsDLsME6EmcuxZiMP68K'
14:17:30 koha_1       | # Looks like you failed 2 tests of 57.
14:17:30 koha_1       | [12:15:56] t/db_dependent/HoldsQueue.t
Comment 7 Jonathan Druart 2021-11-02 13:47:34 UTC
Koha_Master/1805

Another new failure that seems related

     #   Failed test 'Request is correctly advertised as item-level'
     #   at t/db_dependent/HoldsQueue.t line 1343.
     #          got: '0' 
     #     expected: '1' 

     #   Failed test 'Request is correctly advertised as biblio-level'
     #   at t/db_dependent/HoldsQueue.t line 1348.
     #          got: '1' 
     #     expected: '0' 
     # Looks like you failed 2 tests of 4.
.
 #   Failed test 'Item level holds info is preserved (Bug 25738)'
 #   at t/db_dependent/HoldsQueue.t line 1350.
Comment 8 Jonathan Druart 2023-06-07 11:09:26 UTC
Koha_22.11_D11/189

12:35:24 koha_1       |     #   Failed test 'Correct Hold was filled for the correct patron, item group 1, priority 1'
12:35:24 koha_1       |     #   at t/db_dependent/HoldsQueue.t line 1617.
12:35:24 koha_1       |     #          got: '160'
12:35:24 koha_1       |     #     expected: '157'
12:35:24 koha_1       | 
12:35:24 koha_1       |     #   Failed test 'Correct Hold was filled for the correct patron, item group 1, priority 2'
12:35:24 koha_1       |     #   at t/db_dependent/HoldsQueue.t line 1620.
12:35:24 koha_1       |     #          got: '157'
12:35:24 koha_1       |     #     expected: '159'
12:35:24 koha_1       | 
12:35:24 koha_1       |     #   Failed test 'Correct Hold was filled for the correct patron, no item group'
12:35:24 koha_1       |     #   at t/db_dependent/HoldsQueue.t line 1623.
12:35:24 koha_1       |     #          got: '159'
12:35:24 koha_1       |     #     expected: '160'
12:35:24 koha_1       |     # Looks like you failed 3 tests of 4.
12:35:24 koha_1       | 
12:35:24 koha_1       | #   Failed test 'Test item group holds'
12:35:24 koha_1       | #   at t/db_dependent/HoldsQueue.t line 1624.
12:35:24 koha_1       | # Looks like you failed 1 test of 59.
12:35:24 koha_1       | [10:34:18] t/db_dependent/HoldsQueue.t