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

Flaky test: test_websocket_multiple_connections, raises startlette.websockets.WebSocketDisconnect #10203

Open
berland opened this issue Mar 4, 2025 · 1 comment

Comments

@berland
Copy link
Contributor

berland commented Mar 4, 2025

2025-03-04T09:33:54.2398846Z =================================== FAILURES ===================================
2025-03-04T09:33:54.2399491Z _____________________ test_websocket_multiple_connections ______________________
2025-03-04T09:33:54.2400219Z [gw0] linux -- Python 3.11.11 /home/runner/work/ert/ert/.venv/bin/python3
2025-03-04T09:33:54.2400659Z 
2025-03-04T09:33:54.2400987Z monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f430cacfed0>
2025-03-04T09:33:54.2401747Z setup_client = <function setup_client.<locals>.func at 0x7f430ca95260>
2025-03-04T09:33:54.2402174Z 
2025-03-04T09:33:54.2402482Z     def test_websocket_multiple_connections(monkeypatch, setup_client):
2025-03-04T09:33:54.2403104Z         client, subscribers = setup_client()
2025-03-04T09:33:54.2404056Z         credentials = b64encode(b"username:password").decode()
2025-03-04T09:33:54.2404784Z         with client.websocket_connect(
2025-03-04T09:33:54.2405314Z             "/events", headers={"Authorization": f"Basic {credentials}"}
2025-03-04T09:33:54.2405834Z         ) as websocket:
2025-03-04T09:33:54.2406396Z >           event = websocket.receive_json()
2025-03-04T09:33:54.2406693Z 
2025-03-04T09:33:54.2406991Z /home/runner/work/ert/ert/tests/everest/test_everserver.py:267: 
2025-03-04T09:33:54.2407606Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2025-03-04T09:33:54.2408467Z /home/runner/work/ert/ert/.venv/lib/python3.11/site-packages/starlette/testclient.py:183: in receive_json
2025-03-04T09:33:54.2409275Z     self._raise_on_close(message)
2025-03-04T09:33:54.2409699Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2025-03-04T09:33:54.2410005Z 
2025-03-04T09:33:54.2410337Z self = <starlette.testclient.WebSocketTestSession object at 0x7f430c447850>
2025-03-04T09:33:54.2411074Z message = {'code': 1008, 'reason': '', 'type': 'websocket.close'}
2025-03-04T09:33:54.2411572Z 
2025-03-04T09:33:54.2411815Z     def _raise_on_close(self, message: Message) -> None:
2025-03-04T09:33:54.2412319Z         if message["type"] == "websocket.close":
2025-03-04T09:33:54.2413053Z >           raise WebSocketDisconnect(code=message.get("code", 1000), reason=message.get("reason", ""))
2025-03-04T09:33:54.2413783Z E           starlette.websockets.WebSocketDisconnect
2025-03-04T09:33:54.2414096Z 
2025-03-04T09:33:54.2415513Z /home/runner/work/ert/ert/.venv/lib/python3.11/site-packages/starlette/testclient.py:136: WebSocketDisconnect
2025-03-04T09:33:54.2416415Z =============================== warnings summary ===============================
2025-03-04T09:33:54.2416938Z tests/everest/test_api_snapshots.py: 9 warnings

@berland berland moved this to Todo in SCOUT Mar 4, 2025
@berland
Copy link
Contributor Author

berland commented Mar 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant