Bug 26043 - Holds.t is failing randomly
Summary: Holds.t is failing randomly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-22 10:53 UTC by Jonathan Druart
Modified: 2021-06-14 21:31 UTC (History)
4 users (show)

See Also:
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 (1.38 KB, patch)
2020-07-22 12:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26043: Fix random failure from Holds.t (1.44 KB, patch)
2020-08-05 11:16 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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