Bug 32650

Summary: Koha/Holds.t is failing randomly
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.02
Circulation function:
Bug Depends on:    
Bug Blocks: 25551    
Attachments: Bug 32650: Prevent Koha/Holds.t to fail randomly
Bug 32650: Prevent Koha/Holds.t to fail randomly
Bug 32650: Prevent Koha/Holds.t to fail randomly

Description Jonathan Druart 2023-01-17 15:30:50 UTC
15:36:13 koha_1       |     #   Failed test 'Items 1, 2, and 5 are available for filling the holds'
15:36:13 koha_1       |     #   at t/db_dependent/Koha/Holds.t line 532.
15:36:13 koha_1       |     #     Structures begin differing at:
15:36:13 koha_1       |     #          $got->[0] = '1000'
15:36:13 koha_1       |     #     $expected->[0] = '996'
15:36:13 koha_1       |     # Looks like you failed 1 test of 6.
15:36:13 koha_1       | 
15:36:13 koha_1       | #   Failed test 'get_items_that_can_fill'
15:36:13 koha_1       | #   at t/db_dependent/Koha/Holds.t line 540.

Koha_Master_D10/1002
Comment 1 Jonathan Druart 2023-01-18 08:15:41 UTC
Koha_22.05_U20/130
Comment 2 Jonathan Druart 2023-01-18 14:43:56 UTC
(In reply to Jonathan Druart from comment #1)
> Koha_22.05_U20/130

And it was the exact same numbers!

22:25:51 koha_1       |     #   Failed test 'Items 1, 2, and 5 are available for filling the holds'
22:25:51 koha_1       |     #   at t/db_dependent/Koha/Holds.t line 531.
22:25:51 koha_1       |     #     Structures begin differing at:
22:25:51 koha_1       |     #          $got->[0] = '1000'
22:25:51 koha_1       |     #     $expected->[0] = '996'
22:25:51 koha_1       |     # Looks like you failed 1 test of 6.
22:25:51 koha_1       | 
22:25:51 koha_1       | #   Failed test 'get_items_that_can_fill'
22:25:51 koha_1       | #   at t/db_dependent/Koha/Holds.t line 539.
Comment 3 Jonathan Druart 2023-01-18 14:44:12 UTC
ha... sort...
Comment 4 Jonathan Druart 2023-01-18 14:46:23 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2023-01-18 15:07:38 UTC
Created attachment 145397 [details] [review]
Bug 32650: Prevent Koha/Holds.t to fail randomly

22:25:51 koha_1       |     #   Failed test 'Items 1, 2, and 5 are available for filling the holds'
22:25:51 koha_1       |     #   at t/db_dependent/Koha/Holds.t line 531.
22:25:51 koha_1       |     #     Structures begin differing at:
22:25:51 koha_1       |     #          $got->[0] = '1000'
22:25:51 koha_1       |     #     $expected->[0] = '996'
22:25:51 koha_1       |     # Looks like you failed 1 test of 6.
22:25:51 koha_1       |
22:25:51 koha_1       | #   Failed test 'get_items_that_can_fill'
22:25:51 koha_1       | #   at t/db_dependent/Koha/Holds.t line 539.

We need to use a numeric sort, or 1000 is before 996...

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2023-01-18 15:10:51 UTC
I'm not able to reproduce the failure but I can confirm that the test passes successfully with the patch.
Comment 7 Martin Renvoize (ashimema) 2023-01-18 16:49:56 UTC
Created attachment 145402 [details] [review]
Bug 32650: Prevent Koha/Holds.t to fail randomly

22:25:51 koha_1       |     #   Failed test 'Items 1, 2, and 5 are available for filling the holds'
22:25:51 koha_1       |     #   at t/db_dependent/Koha/Holds.t line 531.
22:25:51 koha_1       |     #     Structures begin differing at:
22:25:51 koha_1       |     #          $got->[0] = '1000'
22:25:51 koha_1       |     #     $expected->[0] = '996'
22:25:51 koha_1       |     # Looks like you failed 1 test of 6.
22:25:51 koha_1       |
22:25:51 koha_1       | #   Failed test 'get_items_that_can_fill'
22:25:51 koha_1       | #   at t/db_dependent/Koha/Holds.t line 539.

We need to use a numeric sort, or 1000 is before 996...

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize (ashimema) 2023-01-18 16:51:45 UTC
Keep up the good work!

Pushed to 23.05.x for the next release
Comment 9 Jacob O'Mara 2023-01-18 17:21:43 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.