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

[py] use get_timeout() for urllib pool manager timeouts in remote connection, prevents passing the default socket object directly #10563

Merged

Conversation

symonk
Copy link
Member

@symonk symonk commented Apr 19, 2022

I noticed we are passing the socket._GLOBAL_DEFAULT_TIMEOUT object into the urllib pool manager which I think is a mistake; there already exists a get_timeout() that returns None under that instance; I think we should be calling that instead?

A lot of this is class level state on the RemoteConnection instance; should we move it into the instance and use socket.getdefaulttimeout()? when setting this state it leaks across tests as a bad side effect of global state; so using monkeypatch to tidy up some of the impacted areas

@codecov-commenter
Copy link

Codecov Report

Merging #10563 (f4b82da) into trunk (575b878) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##            trunk   #10563   +/-   ##
=======================================
  Coverage   45.03%   45.03%           
=======================================
  Files          85       85           
  Lines        5507     5507           
  Branches      268      268           
=======================================
  Hits         2480     2480           
  Misses       2759     2759           
  Partials      268      268           
Impacted Files Coverage Δ
py/selenium/webdriver/remote/remote_connection.py 30.14% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 575b878...f4b82da. Read the comment docs.

@AutomatedTester AutomatedTester merged commit 5b84066 into SeleniumHQ:trunk Apr 29, 2022
elgatov pushed a commit to elgatov/selenium that referenced this pull request Jun 27, 2022
…onnection, prevents passing the default socket object directly (SeleniumHQ#10563)

* pass the underlying `timeout` to urls pool manager

* invoke the `get_timeout()` class method for `urllib` timeouts

* fix class state leaking across tests for url lib timeouts; add unit test for default

Co-authored-by: David Burns <[email protected]>
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.

3 participants