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

Add proxy pass through test #1014

Merged
merged 3 commits into from
Oct 3, 2018
Merged

Add proxy pass through test #1014

merged 3 commits into from
Oct 3, 2018

Conversation

nonhermitian
Copy link
Contributor

Summary

Test is bad proxy info raises proxyerror in the API. This means we correctly pass the proxies dict to the API. Note that this test takes a while because the API does not check if a connection can be established before trying the max number of times.

Details and comments

Copy link
Member

@diego-plan9 diego-plan9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the speedy PR!

Can you also take the chance to update the proxies= argument in test_enable_account and test_save_account? They were included as a safety for the proxy handling, but they have the incorrect format.

"""Test proxy pass through."""
prox = {'urls': {
'http': 'http://user:[email protected]:5678',
'https': 'https://user:[email protected]:5678'}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace the host with either an invalid one, or one that resolves quickly: perhaps 127.0.0.1? This way hopefully we avoid the delay, while still getting the error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@nonhermitian
Copy link
Contributor Author

nonhermitian commented Oct 3, 2018

The issue is really not the url that is being connected to, but rather the requests module does not care if it cannot establish a connection, it keeps trying up until the max number of connection attempts is made. See issue #992

@diego-plan9
Copy link
Member

The issue is really not the url that is being connected to, but rather the requests module does not care if it cannot establish a connection, it keeps trying up until the max number of connection attempts is made. See issue #992

Hmm sounds odd - running the tests locally with 127.0.0.1 results in it passing in less than a second, which is actually sort of consistent with your explanation: it attempts to open a connection to the proxy a number of times (which instantly fail), and gives up after max_retries attempts. Do you have a proxy yourself on that port?

Anyway, seems part of another issue indeed - the PR itself is looking ready!

@diego-plan9 diego-plan9 added this to the 0.6 milestone Oct 3, 2018
@nonhermitian nonhermitian merged commit 4693c2a into Qiskit:master Oct 3, 2018
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
* add proxy test

* update proxies
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

Successfully merging this pull request may close these issues.

4 participants