Skip to content

🐛 Fix playwright websocket bug - getting updates for wrong project - #9571

Open
mrnicegyu11 wants to merge 4 commits into
ITISFoundation:masterfrom
mrnicegyu11:2026/improve/playwrightWebsockets
Open

🐛 Fix playwright websocket bug - getting updates for wrong project#9571
mrnicegyu11 wants to merge 4 commits into
ITISFoundation:masterfrom
mrnicegyu11:2026/improve/playwrightWebsockets

Conversation

@mrnicegyu11

@mrnicegyu11 mrnicegyu11 commented Aug 21, 2026

Copy link
Copy Markdown
Member

What do these changes do?

False negative playwright test failure, pipeline 1266387:project close on sim4life.io billable took 1m45s in the sleeper job, letting a stale OPENED/locked project bleed into the next same-user job.

Fix: Make SocketIOProjectStateUpdatedWaiter match on the specific project_uuid returned by the :open response, not on state alone.

Related issue/s

How to test

Dev-ops

@mrnicegyu11 mrnicegyu11 self-assigned this Aug 21, 2026
@github-actions github-actions Bot added the e2e Bugs found by or related to the end-2-end testing label Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.78%. Comparing base (fa4e53a) to head (d6682c4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9571      +/-   ##
==========================================
+ Coverage   87.69%   87.78%   +0.09%     
==========================================
  Files        2105     2129      +24     
  Lines       83070    84354    +1284     
  Branches     1585     1585              
==========================================
+ Hits        72849    74051    +1202     
- Misses       9799     9882      +83     
+ Partials      422      421       -1     
Flag Coverage Δ
integrationtests 63.72% <ø> (+0.03%) ⬆️
unittests 86.72% <ø> (+0.09%) ⬆️
Components Coverage Δ
pkg_aws_library 96.83% <ø> (ø)
pkg_celery_library 78.60% <ø> (ø)
pkg_dask_task_models_library 90.73% <ø> (ø)
pkg_models_library 92.62% <ø> (ø)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database 90.13% <ø> (ø)
pkg_service_integration 73.01% <ø> (ø)
pkg_service_library 71.29% <ø> (+0.02%) ⬆️
pkg_settings_library 90.93% <ø> (ø)
pkg_simcore_sdk 86.42% <ø> (ø)
agent 93.90% <ø> (ø)
api_server 92.99% <ø> (ø)
autoscaling 95.21% <ø> (ø)
catalog 92.47% <ø> (ø)
clusters_keeper 98.61% <ø> (ø)
dask_sidecar 93.38% <ø> (∅)
datcore_adapter 98.08% <ø> (ø)
director 79.01% <ø> (ø)
director_v2 91.92% <ø> (ø)
dynamic_scheduler 95.97% <ø> (ø)
dynamic_sidecar 88.43% <ø> (ø)
efs_guardian 89.40% <ø> (ø)
invitations 91.63% <ø> (ø)
payments 92.17% <ø> (ø)
resource_usage_tracker 92.05% <ø> (+0.15%) ⬆️
storage 88.03% <ø> (-0.04%) ⬇️
webclient ∅ <ø> (∅)
webserver 86.89% <ø> (-0.01%) ⬇️

Continue to review full report in Codecov by Harness.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mrnicegyu11
mrnicegyu11 requested a review from odeimaiz August 21, 2026 09:20
@mrnicegyu11
mrnicegyu11 marked this pull request as ready for review August 21, 2026 09:26

@sanderegg sanderegg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a flaw in this fix in the fact that the project_id is only set at the end. so in effect it could already have returned true due to another project.

Why not gate it with the project_id? and set a warning that the project ID is not set?

Comment thread packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py Outdated
if message.startswith(SOCKETIO_MESSAGE_PREFIX):
decoded_message = decode_socketio_42_message(message)
if decoded_message.name == _OSparcMessages.PROJECT_STATE_UPDATED.value:
if self.project_uuid is not None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is project_uuid allowed to be None per the API contract with the webserver? If so, should this be flagged as an error instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matusdrobuliak66 @bisgaard-itis can you maybe comment on this?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes flaky Playwright E2E behavior caused by projectStateUpdated WebSocket frames from a different project (e.g., a previous job’s still-open project) being misinterpreted as updates for the currently opened project.

Changes:

  • Captures the project UUID from the :open response and uses it to scope subsequent projectStateUpdated matching.
  • Extends SocketIOProjectStateUpdatedWaiter to optionally ignore projectStateUpdated events for other projects.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/e2e-playwright/tests/conftest.py Sets the waiter’s project_uuid based on the opened project’s UUID from the :open HTTP response.
packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py Adds project UUID extraction and optional filtering logic to SocketIOProjectStateUpdatedWaiter to avoid matching updates from unrelated projects.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py Outdated
Comment thread packages/pytest-simcore/src/pytest_simcore/helpers/playwright.py
mrnicegyu11 and others added 3 commits August 25, 2026 11:52
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

e2e Bugs found by or related to the end-2-end testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants