Skip to content

test(e2e): wait for the viewport before adding a segmentation - #6338

Draft
wayfarer3130 wants to merge 2 commits into
masterfrom
test/flaky-segmentation-panel-config
Draft

wayfarer3130 wants to merge 2 commits into
masterfrom
test/flaky-segmentation-panel-config

Conversation

@wayfarer3130

Copy link
Copy Markdown
Contributor

Summary

This PR fixes a cause of failures in the segmentation panel config tests. The PR also adds diagnostics for a second intermittent failure in the RT MPR tests.

Segmentation panel config tests

The tests in SegmentationPanel.spec.ts › "Segmentation panel config input validation for labelmap" fail intermittently in CI. The failures also occur on unrelated branches. The beforeEach times out at config.open() after 10 seconds.

The page snapshot at the timeout shows the cause:

  • The panel still shows only the "Add segmentation" row, and the labelmap tools are disabled. The click on "Add segmentation" did not create a segmentation.
  • createSegmentationForViewport returns undefined and shows no error when the viewport grid has not registered the active viewport yet.
  • SegmentationTableConfig renders null when no segmentation exists. Thus the opacity control never becomes visible.

Changes:

  • tests/pages/RightPanelPageObject.ts: the addSegmentationButton.click() method waits until a viewport is rendered before the click. This change applies to all specs that add a labelmap or contour segmentation.
  • tests/SegmentationPanel.spec.ts: the beforeEach asserts that a segment row exists before it opens the config. If the add step fails again, the error identifies the add step.

RT MPR tests (diagnostics only)

RTHydrationThenMPR.spec.ts and RTDataOverlayNoHydrationThenMPR.spec.ts fail intermittently with page.waitForFunction: Timeout 60000ms exceeded in waitForViewportsRendered. Both tests pass on retry.

The failure video shows that the volume is fully loaded and displayed in all three MPR viewports at 30 seconds. Thus the wait does not fail because the load is slow. One condition of the wait never becomes true. This PR does not increase the timeout, because a longer timeout hides the problem.

Change:

  • tests/utils/waitForViewportsRendered.ts: on a timeout, the error message gives the status of each viewport and the IDs of volumes that did not load. The next failure will show which condition stays false.

Test plan

  • CI runs the Playwright suite, and the segmentation panel config tests pass.
  • If an RT MPR test fails again, the error message contains "Viewport state at timeout".

🤖 Generated with Claude Code

The add-segmentation command silently does nothing when it runs before
the viewport grid has registered the active viewport. The segmentation
panel config tests then timed out waiting for config controls that only
render once a segmentation exists. The add click now waits for a
rendered viewport, and the spec asserts the segment row before opening
the config.

waitForViewportsRendered now reports each viewport's status and any
unloaded volumes on timeout, to diagnose the intermittent RT MPR hangs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit c657dd1
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/6ac666c4663f340008c54a50
😎 Deploy Preview https://deploy-preview-6338--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@wayfarer3130
wayfarer3130 deployed to unrestricted October 7, 2026 14:15 — with GitHub Actions Active
@wayfarer3130
wayfarer3130 deployed to unrestricted October 7, 2026 15:35 — with GitHub Actions Active
@cypress

cypress Bot commented Oct 7, 2026

Copy link
Copy Markdown

Viewers    Run #6875

Run Properties:  status check passed Passed #6875  •  git commit c657dd17c2: Merge remote-tracking branch 'origin/master' into test/flaky-segmentation-panel-...
Project Viewers
Branch Review test/flaky-segmentation-panel-config
Run status status check passed Passed #6875
Run duration 01m 51s
Commit git commit c657dd17c2: Merge remote-tracking branch 'origin/master' into test/flaky-segmentation-panel-...
Committer Bill Wallace
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 28
View all changes introduced in this branch ↗︎

This branch was successfully deployed

1 active deployment
unrestricted — c657dd17 Deployed Oct 7, 2026 by wayfarer3130 via playwright-tests (24.15.0) #5189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant