Bug 23211 - SIP/Transaction.t is failing randomly
Summary: SIP/Transaction.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: 22433
Blocks: 25551
  Show dependency treegraph
 
Reported: 2019-06-25 22:42 UTC by Jonathan Druart
Modified: 2020-11-30 21:45 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03


Attachments
Bug 23211: Prevent SIP/Transaction.t to fail randomly (1.51 KB, patch)
2019-06-25 22:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23211: Prevent SIP/Transaction.t to fail randomly (1.58 KB, patch)
2019-06-26 08:01 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 2019-06-25 22:42:00 UTC
See bug 22433.
Comment 1 Jonathan Druart 2019-06-25 22:42:58 UTC
The checkout failed because patron's category is the one used for statistics (category_type=X).

To recreate the failure:
modified: t/db_dependent/SIP/Transaction.t
@ Transaction.t:37 @ subtest fill_holds_at_checkout => sub {
     plan tests => 6;


-    my $category = $builder->build({ source => 'Category' });
+    my $category = $builder->build({ source => 'Category', value => { category_type => 'X' }});
     my $branch   = $builder->build({ source => 'Branch' });
     my $borrower = $builder->build({ source => 'Borrower', value =>{
         branchcode => $branch->{branchcode},
Comment 2 Jonathan Druart 2019-06-25 22:44:33 UTC
Created attachment 91006 [details] [review]
Bug 23211: Prevent SIP/Transaction.t to fail randomly

The checkout failed because patron's category is the one used for statistics (category_type=X).

To recreate the failure:
modified: t/db_dependent/SIP/Transaction.t
@ Transaction.t:37 @ subtest fill_holds_at_checkout => sub {
     plan tests => 6;

-    my $category = $builder->build({ source => 'Category' });
+    my $category = $builder->build({ source => 'Category', value => { category_type => 'X' }});
     my $branch   = $builder->build({ source => 'Branch' });
     my $borrower = $builder->build({ source => 'Borrower', value =>{
         branchcode => $branch->{branchcode},
Comment 3 Martin Renvoize 2019-06-26 08:01:43 UTC
Created attachment 91010 [details] [review]
Bug 23211: Prevent SIP/Transaction.t to fail randomly

The checkout failed because patron's category is the one used for statistics (category_type=X).

To recreate the failure:
modified: t/db_dependent/SIP/Transaction.t
@ Transaction.t:37 @ subtest fill_holds_at_checkout => sub {
     plan tests => 6;

-    my $category = $builder->build({ source => 'Category' });
+    my $category = $builder->build({ source => 'Category', value => { category_type => 'X' }});
     my $branch   = $builder->build({ source => 'Branch' });
     my $borrower = $builder->build({ source => 'Borrower', value =>{
         branchcode => $branch->{branchcode},

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2019-06-26 08:02:28 UTC
Works as described and causes no regressions.. Thanks Jonathan.

Going straight for a PQA
Comment 5 Martin Renvoize 2019-06-26 08:02:48 UTC
Nice work!

Pushed to master for 19.11.00
Comment 6 Fridolin Somers 2019-07-25 11:41:29 UTC
Pushed to 19.05.x for 19.05.03
Comment 7 Lucas Gass 2019-07-25 21:24:19 UTC
backported to 18.11.x for 18.11.09