Skip to content

Intermittent setup errors in wdspec tests (TimeoutException: timeout (500): Failed to get window handle) #23895

Closed

Description

@jdm

cc @georgeroman

  ▶ TIMEOUT [expected OK] /webdriver/tests/add_cookie/add.py

  ▶ TIMEOUT [expected OK] /webdriver/tests/element_send_keys/events.py

  ▶ Unexpected subtest result in /webdriver/tests/set_window_rect/set.py:
  └ PASS [expected FAIL] test_negative_x_y

  ▶ Unexpected subtest result in /webdriver/tests/get_element_text/get.py:
  │ ERROR [expected PASS] test_read_element_text
  │   → setup error
  │ 
  │ capabilities = {}
  │ configuration = {'capabilities': {}, 'host': '127.0.0.1', 'port': 54704}
  │ request = <SubRequest 'session' for <Function 'test_read_element_text'>>
  │ 
  │     @pytest.fixture(scope="function")
  │     def session(capabilities, configuration, request):
  │         """Create and start a session for a test that does not itself test session creation.
  │     
  │         By default the session will stay open after each test, but we always try to start a
  │         new one and assume that if that fails there is already a valid session. This makes it
  │         possible to recover from some errors that might leave the session in a bad state, but
  │         does not demand that we start a new session per test."""
  │         global _current_session
  │     
  │         # Update configuration capabilities with custom ones from the
  │         # capabilities fixture, which can be set by tests
  │         caps = copy.deepcopy(configuration["capabilities"])
  │         caps.update(capabilities)
  │         caps = {"alwaysMatch": caps}
  │     
  │         # If there is a session with different capabilities active, end it now
  │         if _current_session is not None and (
  │                 caps != _current_session.requested_capabilities):
  │             _current_session.end()
  │             _current_session = None
  │     
  │         if _current_session is None:
  │             _current_session = webdriver.Session(
  │                 configuration["host"],
  │                 configuration["port"],
  │                 capabilities=caps)
  │         try:
  │ >           _current_session.start()
  │ 
  │ capabilities = {}
  │ caps       = {'alwaysMatch': {}}
  │ configuration = {'capabilities': {}, 'host': '127.0.0.1', 'port': 54704}
  │ request    = <SubRequest 'session' for <Function 'test_read_element_text'>>
  │ 
  │ tests/wpt/web-platform-tests/webdriver/tests/support/fixtures.py:150: 
  │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  │ tests/wpt/web-platform-tests/tools/webdriver/webdriver/client.py:429: in start
  │     value = self.send_command("POST", "session", body=body)
  │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  │ 
  │ self = <Session (disconnected)>, method = 'POST', url = 'session'
  │ body = {'capabilities': {'alwaysMatch': {}}}
  │ 
  │     def send_command(self, method, url, body=None):
  │         """
  │             Send a command to the remote end and validate its success.
  │     
  │             :param method: HTTP method to use in request.
  │             :param uri: "Command part" of the HTTP request URL,
  │                 e.g. `window/rect`.
  │             :param body: Optional body of the HTTP request.
  │     
  │             :return: `None` if the HTTP response body was empty, otherwise
  │                 the `value` field returned after parsing the response
  │                 body as JSON.
  │     
  │             :raises error.WebDriverException: If the remote end returns
  │                 an error.
  │             :raises ValueError: If the response body does not contain a
  │                 `value` key.
  │             """
  │         response = self.transport.send(
  │             method, url, body,
  │             encoder=protocol.Encoder, decoder=protocol.Decoder,
  │             session=self)
  │     
  │         if response.status != 200:
  │             err = error.from_response(response)
  │     
  │             if isinstance(err, error.InvalidSessionIdException):
  │                 # The driver could have already been deleted the session.
  │                 self.session_id = None
  │     
  │ >           raise err
  │ E           TimeoutException: timeout (500): Failed to get window handle
  │ 
  │ body       = {'capabilities': {'alwaysMatch': {}}}
  │ err        = <TimeoutException http_status=500>
  │ method     = 'POST'
  │ response   = <Response status=500 error=<TimeoutException http_status=500>>
  │ self       = <Session (disconnected)>
  │ url        = 'session'
  │ 
  └ tests/wpt/web-platform-tests/tools/webdriver/webdriver/client.py:480: TimeoutException

  ▶ Unexpected subtest result in /webdriver/tests/get_element_text/get.py:
  │ ERROR [expected FAIL] test_getting_text_of_a_non_existant_element_is_an_error
  │   → setup error
  │ 
  │ capabilities = {}
  │ configuration = {'capabilities': {}, 'host': '127.0.0.1', 'port': 54704}
  │ request = <SubRequest 'session' for <Function 'test_getting_text_of_a_non_existant_element_is_an_error'>>
  │ 
  │     @pytest.fixture(scope="function")
  │     def session(capabilities, configuration, request):
  │         """Create and start a session for a test that does not itself test session creation.
  │     
  │         By default the session will stay open after each test, but we always try to start a
  │         new one and assume that if that fails there is already a valid session. This makes it
  │         possible to recover from some errors that might leave the session in a bad state, but
  │         does not demand that we start a new session per test."""
  │         global _current_session
  │     
  │         # Update configuration capabilities with custom ones from the
  │         # capabilities fixture, which can be set by tests
  │         caps = copy.deepcopy(configuration["capabilities"])
  │         caps.update(capabilities)
  │         caps = {"alwaysMatch": caps}
  │     
  │         # If there is a session with different capabilities active, end it now
  │         if _current_session is not None and (
  │                 caps != _current_session.requested_capabilities):
  │             _current_session.end()
  │             _current_session = None
  │     
  │         if _current_session is None:
  │             _current_session = webdriver.Session(
  │                 configuration["host"],
  │                 configuration["port"],
  │                 capabilities=caps)
  │         try:
  │ >           _current_session.start()
  │ 
  │ capabilities = {}
  │ caps       = {'alwaysMatch': {}}
  │ configuration = {'capabilities': {}, 'host': '127.0.0.1', 'port': 54704}
  │ request    = <SubRequest 'session' for <Function 'test_getting_text_of_a_non_existant_element_is_an_error'>>
  │ 
  │ tests/wpt/web-platform-tests/webdriver/tests/support/fixtures.py:150: 
  │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  │ tests/wpt/web-platform-tests/tools/webdriver/webdriver/client.py:429: in start
  │     value = self.send_command("POST", "session", body=body)
  │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  │ 
  │ self = <Session (disconnected)>, method = 'POST', url = 'session'
  │ body = {'capabilities': {'alwaysMatch': {}}}
  │ 
  │     def send_command(self, method, url, body=None):
  │         """
  │             Send a command to the remote end and validate its success.
  │     
  │             :param method: HTTP method to use in request.
  │             :param uri: "Command part" of the HTTP request URL,
  │                 e.g. `window/rect`.
  │             :param body: Optional body of the HTTP request.
  │     
  │             :return: `None` if the HTTP response body was empty, otherwise
  │                 the `value` field returned after parsing the response
  │                 body as JSON.
  │     
  │             :raises error.WebDriverException: If the remote end returns
  │                 an error.
  │             :raises ValueError: If the response body does not contain a
  │                 `value` key.
  │             """
  │         response = self.transport.send(
  │             method, url, body,
  │             encoder=protocol.Encoder, decoder=protocol.Decoder,
  │             session=self)
  │     
  │         if response.status != 200:
  │             err = error.from_response(response)
  │     
  │             if isinstance(err, error.InvalidSessionIdException):
  │                 # The driver could have already been deleted the session.
  │                 self.session_id = None
  │     
  │ >           raise err
  │ E           TimeoutException: timeout (500): Failed to get window handle
  │ 
  │ body       = {'capabilities': {'alwaysMatch': {}}}
  │ err        = <TimeoutException http_status=500>
  │ method     = 'POST'
  │ response   = <Response status=500 error=<TimeoutException http_status=500>>
  │ self       = <Session (disconnected)>
  │ url        = 'session'
  │ 
  └ tests/wpt/web-platform-tests/tools/webdriver/webdriver/client.py:480: TimeoutException

Activity

  1. added
    I-intermittent
    on Jul 31, 2019
  2. georgeroman commented on Jul 31, 2019

    @georgeroman
    Contributor

    Never seen this one before. The only place this can get triggered from is here. Is it possible that this takes too long to get a response back?

  3. changed the title [-]Intermittent setup errors in wdspec tests[/-] [+]Intermittent setup errors in wdspec tests (TimeoutException: timeout (500): Failed to get window handle)[/+] on Nov 19, 2019
  4. pwnorbitals commented on Nov 12, 2020

    @pwnorbitals

    Is this fixed ?

  5. jdm commented on Nov 12, 2020

    @jdm
    MemberAuthor

    I'm pretty sure it's been observed in the past few months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-webdriverI-intermittent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions