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

Intermittent setup errors in wdspec tests (SessionNotCreatedException: session not created (500): Session is already started) #24814

Open
jdm opened this issue Nov 21, 2019 · 0 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Nov 21, 2019

  ▶ Unexpected subtest result in /webdriver/tests/element_send_keys/interactability.py:
  │ ERROR [expected FAIL] test_hidden
  │   → setup error
  │ 
  │ capabilities = {}
  │ configuration = {'capabilities': {}, 'host': '127.0.0.1', 'port': 43687}
  │ request = <SubRequest 'session' for <Function 'test_hidden'>>
  │ 
  │     @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': 43687}
  │ request    = <SubRequest 'session' for <Function 'test_hidden'>>
  │ 
  │ 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           SessionNotCreatedException: session not created (500): Session is already started
  │ 
  │ body       = {'capabilities': {'alwaysMatch': {}}}
  │ err        = <SessionNotCreatedException http_status=500>
  │ method     = 'POST'
  │ response   = <Response status=500 error=<SessionNotCreatedException http_status=500>>
  │ self       = <Session (disconnected)>
  │ url        = 'session'
  │ 
  └ tests/wpt/web-platform-tests/tools/webdriver/webdriver/client.py:480: SessionNotCreatedException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.