Bug 21230 - Reserves.t is failing randomly
Summary: Reserves.t is failing randomly
Status: RESOLVED 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:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-15 14:09 UTC by Jonathan Druart
Modified: 2018-09-21 13:04 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 21230: Prevent Reserves.t to fail randomly (1.95 KB, patch)
2018-08-15 15:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21230: Prevent Reserves.t to fail randomly (2.01 KB, patch)
2018-08-16 11:44 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 21230: Prevent Reserves.t to fail randomly (2.07 KB, patch)
2018-08-16 13:14 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 2018-08-15 14:09:18 UTC
koha_1       |     # No tests run!
koha_1       | 
koha_1       | #   Failed test 'No tests run for subtest "_koha_notify_reserve() tests"'
koha_1       | #   at t/db_dependent/Reserves.t line 672.
koha_1       | Can't call method "to_address" on an undefined value at t/db_dependent/Reserves.t line 658.
koha_1       | # Looks like your test exited with 11 just after 56.
koha_1       | [13:19:36] t/db_dependent/Reserves.t ...................................... 
koha_1       | Dubious, test returned 11 (wstat 2816, 0xb00)
koha_1       | Failed 2/57 subtests
Comment 1 Jonathan Druart 2018-08-15 15:25:00 UTC
Created attachment 77837 [details] [review]
Bug 21230: Prevent Reserves.t to fail randomly

The following test can fail if the hold has been generated with found => 'W':
 #   Failed test 'No tests run for subtest "_koha_notify_reserve() tests"'
 #   at t/db_dependent/Reserves.t line 675.
Can't call method "to_address" on an undefined value at
t/db_dependent/Reserves.t line 661.
 # Looks like your test exited with 255 just after 56.

We should call AddReserve instead.

Test plan:
0. Do not apply this patch
1. Do the following change:
    my $hold = $builder->build({
            source => 'Reserve',
            value => {
               borrowernumber=>$hold_borrower,
               found => 'W', # This line is added, do not forget the comma above
            }
        });
2. Prove it makes the test fail
3. stash the changes and apply this patch
4. Make sure the tests pass
Comment 2 Kyle M Hall 2018-08-16 11:44:43 UTC
Created attachment 77901 [details] [review]
Bug 21230: Prevent Reserves.t to fail randomly

The following test can fail if the hold has been generated with found => 'W':
 #   Failed test 'No tests run for subtest "_koha_notify_reserve() tests"'
 #   at t/db_dependent/Reserves.t line 675.
Can't call method "to_address" on an undefined value at
t/db_dependent/Reserves.t line 661.
 # Looks like your test exited with 255 just after 56.

We should call AddReserve instead.

Test plan:
0. Do not apply this patch
1. Do the following change:
    my $hold = $builder->build({
            source => 'Reserve',
            value => {
               borrowernumber=>$hold_borrower,
               found => 'W', # This line is added, do not forget the comma above
            }
        });
2. Prove it makes the test fail
3. stash the changes and apply this patch
4. Make sure the tests pass

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 3 Martin Renvoize 2018-08-16 13:14:48 UTC
Created attachment 77926 [details] [review]
Bug 21230: Prevent Reserves.t to fail randomly

The following test can fail if the hold has been generated with found => 'W':
 #   Failed test 'No tests run for subtest "_koha_notify_reserve() tests"'
 #   at t/db_dependent/Reserves.t line 675.
Can't call method "to_address" on an undefined value at
t/db_dependent/Reserves.t line 661.
 # Looks like your test exited with 255 just after 56.

We should call AddReserve instead.

Test plan:
0. Do not apply this patch
1. Do the following change:
    my $hold = $builder->build({
            source => 'Reserve',
            value => {
               borrowernumber=>$hold_borrower,
               found => 'W', # This line is added, do not forget the comma above
            }
        });
2. Prove it makes the test fail
3. stash the changes and apply this patch
4. Make sure the tests pass

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2018-08-16 13:15:09 UTC
Resolves as promised, Passing QA
Comment 5 Nick Clemens 2018-08-16 14:07:06 UTC
Awesome work all!

Pushed top master for 18.11
Comment 6 Martin Renvoize 2018-08-16 14:28:47 UTC
Pushed to 18.05.x for 18.05.03
Comment 7 Fridolin SOMERS 2018-09-21 13:04:44 UTC
Pushed to 17.11.x for 17.11.10