Repository navigation
fix(test): bound the winit window lifecycle test instead of hanging CI - #2843
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Bounded resize and redraw progress crates/bitty-platform/tests/winit_window.rs |
The test retains the window handle and retries redraw requests during AboutToWait. It schedules another wake after 50 milliseconds and exits when resize or redraw progress occurs. If no progress occurs within 20 seconds, it records a timeout and the test process fails. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
- Issue 2842 describes the
winit_windowtest hanging when a hidden-window redraw does not produce progress. This change adds redraw retries and a bounded timeout to that test. - Issue 2830 describes a product-level bounded-recovery problem. This change bounds the test watchdog but does not add the product-level watchdog.
Possibly related PRs
- bitty-terminal/bitty#2700: Adds redraw tracking and a synthetic occlusion edge for hidden windows, related to the hidden-window redraw condition handled by this test.
- bitty-terminal/bitty#2834: Adds a production hang watchdog and hidden-surface repair probes, separate from this test-only timeout.
Suggested labels: area:platform
Merge Risk: 
Minimal · up to ef74d
-
The window test retries redraws and fails on timeout. No merge-blocking risk is evident.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
The directly linked issue [
#2842] requires a test-only bounded failure path. The diff keeps aWindowHandleinWinitWindowTest, retriesrequest_redraw()on no progress, re-armsset_wait_until(Instant::now() + WATCHDOG_TICK)with a 50 ms interval, and replaces the tick counter with a 20-secondPROGRESS_BUDGET. On expiry, the handler exits,mainprints a diagnostic, and the process returns exit code 1. These changes satisfy the stated coding requirements.
Full details: Out of Scope Changes check
-
Explanation
The change is limited to
crates/bitty-platform/tests/winit_window.rs. The added comments, state changes, watchdog logic, and timeout reporting directly support the CI test fix in [#2842]. No product-level safety-net work or unrelated file changes are present in the reviewed diff.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · 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.
Priority: P1 | Area: ci | Labels: fix,P1,area:ci,area:testing | Milestone: v0.0.31 | RFC: none | Task: CTX-1662
Closes #2842
The
Linux X11 (xvfb)job hung for 18 minutes incargo test -p bitty-platform --test winit_window(run 41280906272) and was cancelled, which also starved the M1 artifact upload and failed the aggregate.Root cause: the test creates a hidden window and depends on the redraw requested from
Resumedarriving. When that request is lost, the defaultControlFlow::Waitblocks with no pending events,about_to_waitis never called again, and the existing watchdog (countingAboutToWaitticks) can never reach its threshold.Fix (test-only,
crates/bitty-platform/tests/winit_window.rs):WindowHandlealive for the whole loop;AboutToWaitwithout progress, re-request the redraw and re-armset_wait_until(now + 50 ms)so the loop keeps ticking;20 stime budget; on expiry the handler exits,mainprints the diagnosis and returns exit code 1.Verification:
cargo test -p bitty-platform: 217 + 7 + 8 + 4 tests pass;created=true resized=Some(785x939) redraw=true, 0.5 s;cargo fmt --check,cargo clippy -p bitty-platform --tests -D warningsclean.Summary by CodeRabbit