-
Notifications
You must be signed in to change notification settings - Fork 447
fix: Stabilize flaky link visibility toggle test #5447
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
Conversation
🎭 Playwright Test Results⏰ Completed at: 09/16/2025, 01:16:22 PM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🔧 Auto-fixes AppliedThis PR has been automatically updated to fix linting and formatting issues.
Changes made:
|
🔧 Auto-fixes AppliedThis PR has been automatically updated to fix linting and formatting issues.
Changes made:
|
The test was flaky because it wasn't properly waiting for the canvas to update after changing the link render mode setting. The setting change triggers a canvas redraw via setDirty(), but the actual redraw happens asynchronously. Changes: - Add explicit wait for canvas.links_render_mode to update - Capture initial link render mode to properly verify state changes - Add double frame wait plus 100ms delay to ensure canvas redraw completes - Improve wait condition for visible links to handle undefined initial state - Add timeout protection to prevent test hanging This ensures the test reliably waits for both the setting change and the visual update before taking screenshots, eliminating the race condition that was causing intermittent failures.
107af0a to
f66afd7
Compare
The test was flaky because it wasn't properly waiting for the canvas to update after changing the link render mode setting. The setting change triggers a canvas redraw via setDirty(), but the actual redraw happens asynchronously. Changes: - Add explicit wait for canvas.links_render_mode to update - Capture initial link render mode to properly verify state changes - Add double frame wait plus 100ms delay to ensure canvas redraw completes - Improve wait condition for visible links to handle undefined initial state - Add timeout protection to prevent test hanging This ensures the test reliably waits for both the setting change and the visual update before taking screenshots, eliminating the race condition that was causing intermittent failures.
f66afd7 to
a6f3709
Compare
…fy-Org/ComfyUI_frontend into sno-fix-flaky-toggle-link-visibility
Replace fixed delays with frame counter monitoring to ensure canvas has completed rendering before taking screenshots. This eliminates race conditions and makes the test more reliable. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
problem prob solved by waiting for link_hidden status by page.evaluate but this impl is a bit too hacky. |
|
This should be fixed on |
|
close this PR as already fixed. |
Summary
This PR fixes a flaky test in the graph canvas menu that was intermittently failing in CI. The test was checking link visibility toggle functionality but wasn't properly waiting for the canvas to update after changing settings.
Problem
The test
Can toggle link visibilitywas flaky because:nextFrame()The issue was that changing the
Comfy.LinkRenderModesetting triggers an async canvas redraw viasetDirty(), but the actual redraw might not complete within a single frame.Solution
Added proper synchronization:
waitForFunctionto wait untilcanvas.links_render_modeactually changesnextFrame()twice to ensure the canvas redraw completesTesting
The fix ensures that:
This should eliminate the race condition that was causing intermittent failures.
Related Code
The link visibility toggle is handled by:
Comfy.Canvas.ToggleLinkVisibilityinuseCoreCommands.tsuseLitegraphSettings.tswatchesComfy.LinkRenderModeand updates canvascanvas.setDirty(false, true)to trigger background redrawFixes the flaky test issue reported in CI.
┆Issue is synchronized with this Notion page by Unito