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

Webserver fixture timeout is causing intermittent test failures #354

Closed
b4handjr opened this issue Feb 21, 2025 · 1 comment
Closed

Webserver fixture timeout is causing intermittent test failures #354

b4handjr opened this issue Feb 21, 2025 · 1 comment
Assignees

Comments

@b4handjr
Copy link
Contributor

Our webserver fixture that is used to serve notifications for our tests is sometimes causing the tests to fail due to a ConnectionReset Error.

=================================== FAILURES ===================================
___________ test_progress_notification_downloading[firefox_options0] ___________

browser = <foxpuppet.windows.browser.window.BrowserWindow object at 0x7fa3ccc51520>
progress_notification = <foxpuppet.windows.browser.notifications.addons.AddOnProgress object at 0x7fa3ccc35010>

    @pytest.mark.parametrize(
        "firefox_options", [{"page_load_strategy_none": True}], indirect=True
    )
    def test_progress_notification_downloading(
        browser: BrowserWindow, progress_notification: AddOnProgress
    ) -> None:
        """Verify downloading status is reported correctly."""
        description = progress_notification.is_downloading
>       assert description is True
E       assert False is True

tests/test_notifications.py:260: AssertionError
---------------------------- Captured stderr setup -----------------------------
127.0.0.1 - - [21/Feb/2025 13:48:11] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/Feb/2025 13:48:11] code 404, message File not found
127.0.0.1 - - [21/Feb/2025 13:48:11] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [21/Feb/2025 13:48:11] "GET /largewebextension.xpi HTTP/1.1" 200 -
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 52156)
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/socketserver.py", line 318, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/socketserver.py", line 349, in process_request
    self.finish_request(request, client_address)
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/socketserver.py", line 362, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/runner/work/FoxPuppet/FoxPuppet/tests/webserver.py", line 19, in __init__
    super().__init__(*args, directory=self.directory, **kwargs)
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/http/server.py", line 672, in __init__
    super().__init__(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/socketserver.py", line 766, in __init__
    self.handle()
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/http/server.py", line 436, in handle
    self.handle_one_request()
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/http/server.py", line 424, in handle_one_request
    method()
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/http/server.py", line 679, in do_GET
    self.copyfile(f, self.wfile)
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/http/server.py", line 878, in copyfile
    shutil.copyfileobj(source, outputfile)
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/shutil.py", line 204, in copyfileobj
    fdst_write(buf)
  File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/socketserver.py", line 845, in write
    self._sock.sendall(b)
ConnectionResetError: [Errno 104] Connection reset by peer
----------------------------------------
127.0.0.1 - - [21/Feb/2025 13:48:11] "GET /largewebextension.xpi HTTP/1.1" 200 -
------------------------------- pytest-selenium --------------------------------
Driver log: /tmp/pytest-of-runner/pytest-0/test_progress_notification_dow0/driver.log
URL: http://127.0.0.1:36273/
WARNING: Failed to gather log types: Message: HTTP method not allowed
@b4handjr
Copy link
Contributor Author

This isn't causing our tests to fail, as the server will still serve the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants