Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tests still try to use the network even when NETWORK_TESTING is not set #184

Open
zoffixznet opened this issue Dec 29, 2017 · 3 comments

Comments

@zoffixznet
Copy link
Contributor

Spotted this in a travis run:

[...]
# NETWORK_TESTING was not set
t/200-w3-test-encodings.t .. ok
t/210-content-encoding.t ... ok
t/220-binary-content.t ..... ok
t/230-binary-request.t ..... ok
    # Failed test 'right exception type (HTTP::UserAgent::Exception::X::HTTP::Internal)'
    # at /home/travis/.rakudobrew/moar-master/install/share/perl6/precomp/BE65026BFB5249C3382F8EDFB81A28020AC84608.1514511444.50491/C7/C712FE6969F786C9380D643DF17E85D06868219E line 1
    # Expected: HTTP::UserAgent::Exception::X::HTTP::Internal
    # Got:      X::AdHoc
    # Exception message: Could not connect socket: Connection refused
    # Looks like you failed 1 test of 3
# Failed test 'throws the correct exception'
# at t/250-issue-144.t line 28
# Looks like you failed 1 test of 1
t/250-issue-144.t .......... 
[...]
@bbkr
Copy link

bbkr commented Mar 10, 2018

This breaks CI for other modules using HTTP::UserAgent: https://travis-ci.org/bbkr/jsonrpc/jobs/351673499 .

@zostay
Copy link

zostay commented Aug 6, 2018

Assuming I'm reading the code correctly, NETWORK_TESTING is a red herring. This problem has nothing to do with that.

I am running into this here: https://travis-ci.org/zostay/Amazon-DynamoDB/jobs/412756488

Looking at how the server is startup, my guess is that there's either a problem with how the test selects an available port or the timing. I suspect a timing issue. Since the server is running in a separate thread, it does not appear to be the case that the code guarantees that the server is running before it tries to contact it.

@zostay
Copy link

zostay commented Aug 6, 2018

Looking through the build history of HTTP::UserAgent, the error occurs there too. For example,

https://travis-ci.org/sergot/http-useragent/builds/341064491

zostay added a commit to zostay/Amazon-DynamoDB that referenced this issue Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants