Bug 26043

Summary: 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: aleisha, lucas, martin.renvoize, victor
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24657
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03, 19.11.09, 19.05.15
Attachments: Bug 26043: Fix random failure from Holds.t
Bug 26043: Fix random failure from Holds.t

Description Jonathan Druart 2020-07-22 10:53:28 UTC
Master_U20 #41

15:40:07 koha_1       | #   Failed test 'Test ModReserveMinusPriority()'
15:40:07 koha_1       | #   at t/db_dependent/Holds.t line 202.
15:40:07 koha_1       | #          got: undef
15:40:07 koha_1       | #     expected: '1605'
15:40:48 koha_1       | # Looks like you failed 1 test of 66.
15:40:48 koha_1       | [13:40:48] t/db_dependent/Holds.t

Already reported on bug 24657 comment 4.
Comment 1 Jonathan Druart 2020-07-22 12:57:45 UTC
Created attachment 107178 [details] [review]
Bug 26043: Fix random failure from Holds.t

#   Failed test 'Test ModReserveMinusPriority()'
 #   at t/db_dependent/Holds.t line 202.
 #          got: undef
 #     expected: '1605'
 # Looks like you failed 1 test of 66.

It is coming from Koha::Patron->holds that is ordering by reservedate,
so "sometimes" they are ordered in reverse (at least it's my
understanding of the problem).

Test plan:
Run the test file several times (from 20 to 60x), it must never fail
with this patch
Comment 2 Martin Renvoize 2020-08-05 11:16:18 UTC
Created attachment 107829 [details] [review]
Bug 26043: Fix random failure from Holds.t

 #   Failed test 'Test ModReserveMinusPriority()'
 #   at t/db_dependent/Holds.t line 202.
 #          got: undef
 #     expected: '1605'
 # Looks like you failed 1 test of 66.

It is coming from Koha::Patron->holds that is ordering by reservedate,
so "sometimes" they are ordered in reverse (at least it's my
understanding of the problem).

Test plan:
Run the test file several times (from 20 to 60x), it must never fail
with this patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2020-08-05 11:17:20 UTC
Verified the tests is still testing for what it should be with the code update
Varified that the tests pass consistently over multiple runs.

Code is clear and easy to follow..

Passing QA
Comment 4 Jonathan Druart 2020-08-05 15:36:57 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 5 Lucas Gass 2020-08-13 18:02:16 UTC
backported to 20.05.x for 20.05.03
Comment 6 Aleisha Amohia 2020-08-16 21:35:11 UTC
backported to 19.11.x for 19.11.09
Comment 7 Victor Grousset/tuxayo 2020-09-20 11:16:50 UTC
Backported to 19.05.x branch for 19.05.15