Bug 19403 - Again and again, Circulation.t is failing randomly
Summary: Again and again, Circulation.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: 19009
Blocks: 25551 19776 20721
  Show dependency treegraph
 
Reported: 2017-10-03 17:11 UTC by Jonathan Druart
Modified: 2020-05-20 12:26 UTC (History)
2 users (show)

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


Attachments
Bug 19403: Add some default values when building patrons for test (934 bytes, patch)
2017-10-03 17:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19403: Prevent Circulation.t to fail randomly (17.70 KB, patch)
2017-10-03 17:36 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2017-10-03 17:11:49 UTC
#   Failed test 'No error or alert should be raised'
    #   at t/db_dependent/Circulation.t line 1553.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'BIBLIO_ALREADY_ISSUED question flag should be set if AllowMultipleIssuesOnABiblio=0 and issue already exists'
    #   at t/db_dependent/Circulation.t line 1554.
    #          got: undef
    #     expected: '1'

    #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if AllowMultipleIssuesOnABiblio=1'
    #   at t/db_dependent/Circulation.t line 1558.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if it is a subscription'
    #   at t/db_dependent/Circulation.t line 1565.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'No BIBLIO_ALREADY_ISSUED flag should be set if it is a subscription'
    #   at t/db_dependent/Circulation.t line 1569.
    #          got: '1'
    #     expected: '0'
    # Looks like you failed 5 tests of 5.

#   Failed test 'CanBookBeIssued + AllowMultipleIssuesOnABiblio'
#   at t/db_dependent/Circulation.t line 1570.
# Looks like you failed 1 test of 102.
[15:00:27] t/db_dependent/Circulation.t ...................................
Comment 1 Jonathan Druart 2017-10-03 17:36:32 UTC
Created attachment 67565 [details] [review]
Bug 19403: Add some default values when building patrons for test

To avoid some tests to fail randomly

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 2 Jonathan Druart 2017-10-03 17:36:37 UTC
Created attachment 67566 [details] [review]
Bug 19403: Prevent Circulation.t to fail randomly

Due to the number of test cases handle by CanBookBeIssued, Circulation.t
fails randomly. To prevent that it is better to set some values.
For instance if the patron is a statistical patron (category_type=X),
the subroutine will return a STATS flag.

This patch also adds a subroutine to the test file to display the keys
of $error, $question and $alert set by CanBookBeIssued.
It will be easier to track other random failures.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Jonathan Druart 2017-10-03 17:37:33 UTC
Pushed to master for 17.11.
Comment 4 Fridolin Somers 2017-10-27 13:07:29 UTC
Pushed to 17.05.x, will be in 17.05.06.
Comment 5 Katrin Fischer 2017-10-29 18:44:31 UTC
Depends on a bug that is not in 16.11.x (didn't apply). Please fix dependencies if you want this to be included.