Bug 24022 - Z3950Responder tests are failing randomly
Summary: Z3950Responder tests are failing randomly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 13937
Blocks: 25551
  Show dependency treegraph
 
Reported: 2019-11-12 15:46 UTC by Jonathan Druart
Modified: 2020-11-30 21:45 UTC (History)
4 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
Circulation function:


Attachments
Bug 24022: Prevent Session2.t to fail if run after Session.t (1.35 KB, patch)
2019-11-12 16:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24022: Remove unecessary delete from authorised_values (987 bytes, patch)
2019-11-12 16:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24022: Try to fix 'connect failed' (1.59 KB, patch)
2019-11-12 16:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24022: Prevent Session2.t to fail if run after Session.t (1.40 KB, patch)
2019-11-13 11:30 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 24022: Remove unecessary delete from authorised_values (1.02 KB, patch)
2019-11-13 11:30 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 24022: Try to fix 'connect failed' (1.64 KB, patch)
2019-11-13 11:30 UTC, Nick Clemens (kidclamp)
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-11-12 15:46:38 UTC
koha_1       | #   Failed test 'test_search'
koha_1       | #   at t/db_dependent/Koha/Z3950Responder/GenericSession.t line 152.
koha_1       | ZOOM error 10000 "Connect failed" (addinfo: "localhost:42111") from diag-set 'ZOOM'# Looks like your test exited with 255 just after 3.
koha_1       | [14:13:54] t/db_dependent/Koha/Z3950Responder/GenericSession.t


koha_1       | #   Failed test 'test_search'
koha_1       | #   at t/db_dependent/Koha/Z3950Responder/ZebraSession.t line 118.
koha_1       | ZOOM error 10000 "Connect failed" (addinfo: "127.0.0.1:42111") from diag-set 'ZOOM'# Looks like your test exited with 255 just after 3.
koha_1       | [14:36:24] t/db_dependent/Koha/Z3950Responder/ZebraSession.t
Comment 1 Jonathan Druart 2019-11-12 16:01:09 UTC
We have a race condition here, I guess that's why we get the "Connect failed".

kohadev-koha@c46b1ba2057e:/kohadevbox/koha$ prove t/db_dependent/Koha/Z3950Responder/Session*.t 
t/db_dependent/Koha/Z3950Responder/Session2.t .. ok   
t/db_dependent/Koha/Z3950Responder/Session.t ... 1/3 
    #   Failed test 'All statuses added in one field as expected'
    #   at t/db_dependent/Koha/Z3950Responder/Session.t line 63.
    #          got: 'Checked Out, Lost, Not for Loan, Borked completely, Withdrawn, In Transit, On Hold'
    #     expected: 'Checked Out, Lost, Not for Loan, Damaged, Withdrawn, In Transit, On Hold'

    #   Failed test 'Available status added as expected'
    #   at t/db_dependent/Koha/Z3950Responder/Session.t line 66.
    #          got: 'Free as a bird'
    #     expected: 'Available'
    # Looks like you failed 2 tests of 2.
t/db_dependent/Koha/Z3950Responder/Session.t ... 3/3 
#   Failed test 'add_item_status'
#   at t/db_dependent/Koha/Z3950Responder/Session.t line 68.
# Looks like you failed 1 test of 3.
t/db_dependent/Koha/Z3950Responder/Session.t ... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests 

Test Summary Report
-------------------
t/db_dependent/Koha/Z3950Responder/Session.t (Wstat: 256 Tests: 3 Failed: 1)
  Failed test:  3
  Non-zero exit status: 1
Files=2, Tests=6,  6 wallclock secs ( 0.01 usr  0.01 sys +  4.65 cusr  1.31 csys =  5.98 CPU)
Result: FAIL
Comment 2 Jonathan Druart 2019-11-12 16:07:14 UTC
Ok, maybe not.

    #   Failed test 'All statuses added in one field as expected'
    #   at t/db_dependent/Koha/Z3950Responder/Session.t line 63.
    #          got: 'Checked Out, Lost, Not for Loan, Borked completely, Withdrawn, In Transit, On Hold'
    #     expected: 'Checked Out, Lost, Not for Loan, Damaged, Withdrawn, In Transit, On Hold'

    #   Failed test 'Available status added as expected'
    #   at t/db_dependent/Koha/Z3950Responder/Session.t line 66.
    #          got: 'Free as a bird'
    #     expected: 'Available'
    # Looks like you failed 2 tests of 2.

=> This happens when Session2.t is run before Session.t

To recreate:
prove t/db_dependent/Koha/Z3950Responder/Session2.t t/db_dependent/Koha/Z3950Responder/Session.t

I do not recreate the "Connect failed" when logged in to the container
Comment 3 Jonathan Druart 2019-11-12 16:17:47 UTC
Created attachment 95332 [details] [review]
Bug 24022: Prevent Session2.t to fail if run after Session.t

Cache must be cleaned!
Comment 4 Jonathan Druart 2019-11-12 16:17:51 UTC
Created attachment 95333 [details] [review]
Bug 24022: Remove unecessary delete from authorised_values

Why do we need that exactly?
The cache is not flushed so it should not be needed.
Comment 5 Jonathan Druart 2019-11-12 16:36:04 UTC
Created attachment 95336 [details] [review]
Bug 24022: Try to fix 'connect failed'

I am assuming that the tests fail on Jenkins's nodes because they are
too slow. The server is not setup yet when we are trying to access it.
Just a guess...

Note that sleep is usually a bad idea...
Comment 6 Nick Clemens (kidclamp) 2019-11-13 11:30:37 UTC
Created attachment 95362 [details] [review]
Bug 24022: Prevent Session2.t to fail if run after Session.t

Cache must be cleaned!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens (kidclamp) 2019-11-13 11:30:40 UTC
Created attachment 95363 [details] [review]
Bug 24022: Remove unecessary delete from authorised_values

Why do we need that exactly?
The cache is not flushed so it should not be needed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Nick Clemens (kidclamp) 2019-11-13 11:30:43 UTC
Created attachment 95364 [details] [review]
Bug 24022: Try to fix 'connect failed'

I am assuming that the tests fail on Jenkins's nodes because they are
too slow. The server is not setup yet when we are trying to access it.
Just a guess...

Note that sleep is usually a bad idea...

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Martin Renvoize (ashimema) 2019-11-13 13:19:06 UTC
This all looks sane to me, passing QA and pushing.
Comment 10 Martin Renvoize (ashimema) 2019-11-13 13:20:13 UTC
Nice work!

Pushed to master for 19.11.00
Comment 11 Fridolin Somers 2019-11-15 12:10:44 UTC
Depends on Bug 13937 not in 19.05.x