Skip to content

Tests: the export-dialog test waits with the crate's background-work bound - #3090

Closed
sm18lr88 wants to merge 1 commit into
storytold:mainfrom
sm18lr88:pr/export-dialog-test-deadline
Closed

sm18lr88 wants to merge 1 commit into
storytold:mainfrom
sm18lr88:pr/export-dialog-test-deadline

Conversation

@sm18lr88

@sm18lr88 sm18lr88 commented Oct 26, 2026 •

Copy link
Copy Markdown

Found while testing crates/ui-egui/src/tests_dialog_fit.rs (no existing issue): export_dialog_fits_a_short_window_and_its_button_exports failed with assertion failed: h.step_until(Duration::from_secs(60), ...) on a machine that was also building two other branches. Run alone it passes.

Cause

The test clicks Export and then waited at most 60 s of wall time for a real export, running on background threads, to finish. That is a guess at how fast the machine is, so whether it passed depended on load.

Fix

The wait uses a new EXPORT_DONE (120 s), the bound this crate already uses for real background work (SETTLE in headless.rs and tests_album_picker.rs), and the assertion says which window size it was waiting for. It still ends as soon as the export does; only a hung export takes longer to report. The file's T (20 s, for UI requests) is unchanged. Test-only: 1 file, +4 -1.

Verified

  • cargo test -p lightcraft-ui-egui --lib tests_dialog_fit: 6 passed, 0 failed (includes export_dialog_fits_a_short_window_and_its_button_exports, export_dialog_cancel_is_on_screen_in_a_short_window, export_dialog_is_unchanged_in_a_tall_window).
  • cargo check --workspace --all-targets --locked, cargo fmt --check and cargo check --target wasm32-unknown-unknown -p lightcraft-web --locked clean.
  • cargo clippy -p lightcraft-ui-egui --all-targets -- -D warnings clean on current stable (1.99.1).

Summary by CodeRabbit

  • Tests
    • The export dialog’s automated completion check now allows up to 120 seconds for an export to finish, increased from 60 seconds. The check retains a defined time limit while allowing more time for background processing. This change affects the automated test only; it does not change the export experience or available functionality.

…bound

tests_dialog_fit::export_dialog_fits_a_short_window_and_its_button_exports
clicks Export and then waited at most 60 s of wall time for the export - real
work on background threads - to finish. On a machine that was also building
two other branches it did not ("assertion failed: h.step_until(Duration::
from_secs(60), ...)"), while alone it passes 3 of 3 in 8-9 s. Whether it
passed depended on load.

The wait now uses EXPORT_DONE, 120 s - the bound the crate uses for real
background work (SETTLE in headless.rs and the other tests_* files) - and
says which window size it was waiting for. It still ends as soon as the
export does; only a hung export takes longer to report. The file's T (20 s)
is for UI requests and stays as it is.

Test-only change.

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

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between bb08a69 and cac8e27.

Files selected for processing: 1
  • crates/ui-egui/src/tests_dialog_fit.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The export-dialog test now defines a documented 120-second timeout for background export work. Its completion wait uses this timeout instead of a hard-coded 60-second limit.

Changes: Export test timeout

Layer / File(s) Summary
Export completion timeout
crates/ui-egui/src/tests_dialog_fit.rs
The test defines a 120-second timeout and uses it when waiting for export completion.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related issues

  • Fixed wall-clock test limits under machine load: this change increases one bounded export wait, but does not add assertion context.
  • Bounded and scalable test waits: this change updates one bounded wait, but does not add a shared deadline helper or time scaling.

Suggested reviewers: skylartaylor

Merge Risk: Minimal · up to cac8e

The test-only timeout adjustment does not introduce a merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: the export-dialog test now waits with the crate's background-work bound. The objectives confirm the wait moves from 60 to 120 seconds, and the change is test-only in tests_…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: the export-dialog test now waits with the crate's background-work bound. The objectives confirm the wait moves from 60 to 120 seconds, and the change is test-only in tests_dialog_fit.rs. The title is specific and matches the main change. The phrase "the crate's background-work bound" is slightly abstract, since the value itself (120 seconds) is not stated, but it still describes the real change.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

sm18lr88 added a commit to sm18lr88/lightcraft that referenced this pull request Oct 27, 2026
What: the WIDER FACE run sets only its own score, overlap and count limits and takes every other
yunet::Options field from Options::default(), with an allow for clippy::needless_update.
Why: listing every field made the benchmark stop compiling as soon as Options gains a field; storytold#3092
adds one (long_edge), so whichever of storytold#3092 and this PR merged second would break the build.
Evidence: origin/main + storytold#3090 + storytold#3091 + storytold#3092 + this PR at 4e658ec: cargo check exit 101,
E0063 missing field long_edge in xtask/src/ai_bench/wider.rs; with this commit the same merge passes
cargo check, and this branch alone passes fmt, clippy 1.95.0 / 1.99.1 -D warnings and the xtask tests.

@THEtheChad THEtheChad 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.

The diagnosis is right: a fixed wall-clock wait for real background work fails when the machine is loaded. Doubling it only moves the threshold, though, and adds another copy of the 120 s constant (SETTLE is already defined separately in at least seven test files). #3096 (LIGHTCRAFT_TIME_SCALE, scaled()) and #3083 (testkit deadline helpers) address this for every test at once; it would be better to build on those than to bump one test.

Also, this file moved to crates/ui-egui/src/tests/dialog_fit.rs in #3103, so the PR needs a rebase.

@sm18lr88

Copy link
Copy Markdown
Author

Thanks, agreed: a longer fixed deadline only moves the threshold, and #3096 (deadlines that scale with LIGHTCRAFT_TIME_SCALE) and #3083 (testkit deadline helpers) fix this for every test at once. Closing this in favour of those. Once they land, export_dialog_fits_a_short_window_and_its_button_exports gets the scaled deadline with the rest; if it still fails under load after that, I'll open a fresh PR against the new location (crates/ui-egui/src/tests/dialog_fit.rs).

@sm18lr88 sm18lr88 closed this Oct 27, 2026
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.

2 participants