Bug 25540 - Biblio.t is failing randomly
Summary: Biblio.t is failing randomly
Status: Pushed to master
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: 22284
Blocks: 25551
  Show dependency treegraph
 
Reported: 2020-05-19 10:27 UTC by Jonathan Druart
Modified: 2020-05-26 13:27 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 25540: Use build_sample_item (4.02 KB, patch)
2020-05-19 13:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25540: DO NOT PUSH - diag statement (1.45 KB, patch)
2020-05-19 13:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25540: Default for branches.pickup_location must be 0 (926 bytes, patch)
2020-05-22 13:34 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25540: Use build_sample_item (4.07 KB, patch)
2020-05-22 22:39 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 25540: DO NOT PUSH - diag statement (1.51 KB, patch)
2020-05-22 22:40 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 25540: Default for branches.pickup_location must be 0 (984 bytes, patch)
2020-05-22 22:40 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 25540: Use build_sample_item (4.14 KB, patch)
2020-05-23 07:34 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 25540: Default for branches.pickup_location must be 0 (1.02 KB, patch)
2020-05-23 07:34 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-05-19 10:27:09 UTC
Master_DO #874
11:37:04 koha_1       |     #   Failed test 'ReservesControlBranch: ItemHomeLibrary, biblio1, patron1 should return 6 but returns 7'
11:37:04 koha_1       |     #   at t/db_dependent/Koha/Biblio.t line 408.
11:37:04 koha_1       | 
11:37:04 koha_1       |     #   Failed test 'ReservesControlBranch: PatronLibrary, biblio1, patron1 should return 6 but returns 7'
11:37:04 koha_1       |     #   at t/db_dependent/Koha/Biblio.t line 408.
11:37:05 koha_1       |     # Looks like you planned 29 tests but ran 31.
11:37:05 koha_1       |     # Looks like you failed 2 tests of 31 run.
11:37:05 koha_1       | 
11:37:05 koha_1       | #   Failed test 'pickup_locations'
11:37:05 koha_1       | #   at t/db_dependent/Koha/Biblio.t line 435.
11:37:06 koha_1       | # Looks like you failed 1 test of 12.
11:37:06 koha_1       | [09:37:06] t/db_dependent/Koha/Biblio.t 

Was failing earlier on D10 as well.
Comment 1 Jonathan Druart 2020-05-19 13:32:33 UTC
Created attachment 105093 [details] [review]
Bug 25540: Use build_sample_item
Comment 2 Jonathan Druart 2020-05-19 13:32:37 UTC
Created attachment 105094 [details] [review]
Bug 25540: DO NOT PUSH - diag statement
Comment 3 Jonathan Druart 2020-05-19 13:34:08 UTC
I have no idea what's going in here. There is a library that is picked from... somewhere? See second patch.

Run the tests several times and it will fail at some point (before 30th run usually)
Comment 4 Jonathan Druart 2020-05-20 12:17:08 UTC
Again, Master_U18 #796
Comment 5 Jonathan Druart 2020-05-20 12:17:51 UTC
IMO This needs to be addressed for 20.05
Comment 6 Jonathan Druart 2020-05-22 13:05:30 UTC
Related test in t/db_dependent/Template/Plugin/Branches.t is failing as well:

14:31:13 koha_1       |         #   Failed test 'Libraries count is correct'
14:31:13 koha_1       |         #   at t/db_dependent/Template/Plugin/Branches.t line 176.
14:31:13 koha_1       |         #          got: '4'
14:31:13 koha_1       |         #     expected: '3'
14:31:13 koha_1       | 
14:31:13 koha_1       |         #   Failed test 'Libraries count is correct'
14:31:13 koha_1       |         #   at t/db_dependent/Template/Plugin/Branches.t line 184.
14:31:13 koha_1       |         #          got: '4'
14:31:13 koha_1       |         #     expected: '3'
14:31:13 koha_1       |         # Looks like you failed 2 tests of 4.
14:31:13 koha_1       | 
14:31:13 koha_1       |     #   Failed test 'selected tests'
14:31:13 koha_1       |     #   at t/db_dependent/Template/Plugin/Branches.t line 189.
14:31:13 koha_1       |     # Looks like you failed 1 test of 8.
14:31:13 koha_1       | 
14:31:13 koha_1       | #   Failed test 'pickup_locations() tests'
14:31:13 koha_1       | #   at t/db_dependent/Template/Plugin/Branches.t line 192.
Comment 7 Jonathan Druart 2020-05-22 13:34:21 UTC
Created attachment 105266 [details] [review]
Bug 25540: Default for branches.pickup_location must be 0

This is a try to fix failures in both
t/db_dependent/Template/Plugin/Branches.t
t/db_dependent/Koha/Biblio.t
Comment 8 Tomás Cohen Arazi 2020-05-22 22:39:58 UTC
Created attachment 105290 [details] [review]
Bug 25540: Use build_sample_item

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Tomás Cohen Arazi 2020-05-22 22:40:03 UTC
Created attachment 105291 [details] [review]
Bug 25540: DO NOT PUSH - diag statement

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 10 Tomás Cohen Arazi 2020-05-22 22:40:08 UTC
Created attachment 105292 [details] [review]
Bug 25540: Default for branches.pickup_location must be 0

This is a try to fix failures in both
t/db_dependent/Template/Plugin/Branches.t
t/db_dependent/Koha/Biblio.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 11 Tomás Cohen Arazi 2020-05-22 22:50:27 UTC
Tha changes 'make sense'. But the Biblio.t tests explicitly delete all libraries and the added ones are totally controlled in terms of the pickup_location flag.

I certainly reproduced the failure in t/db_dependent/Template/Plugin/Branches.t with a loop calling the test 30 times, and couldn't reproduce it after applying the patches.
Comment 12 Martin Renvoize 2020-05-23 07:33:14 UTC
Thanks guys.. Passing QA on this one too, changes make sense and tests now pass consistently for me.
Comment 13 Martin Renvoize 2020-05-23 07:34:20 UTC
Created attachment 105296 [details] [review]
Bug 25540: Use build_sample_item

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2020-05-23 07:34:23 UTC
Created attachment 105297 [details] [review]
Bug 25540: Default for branches.pickup_location must be 0

This is a try to fix failures in both
t/db_dependent/Template/Plugin/Branches.t
t/db_dependent/Koha/Biblio.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 15 Martin Renvoize 2020-05-23 07:34:41 UTC
Nice work everyone!

Pushed to master for 20.05