Skip to content

test(engine): sweep a PDF's cancellation checks on a small page - #3573

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:test/cancel-sweep-pdf-page
Dec 2, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:test/cancel-sweep-pdf-page

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Summary

cancelling_at_each_check_leaves_nothing_behind decides how long the test job takes: it runs alone at the end for 3 to 7 minutes while the other cores wait. Nearly all of it (822 of 857 seconds on one machine) is one of its 94 cases, adding a one-page PDF. At each of that case's 32 checks, the sweep draws, measures and compares every pixel of an A4 page.

The page is now 50 mm square, which reaches the same 32 checks. A 25 mm page reaches only 18, so it isn't smaller still. Nothing but the fixture changes.

Page That case Checks reached
A4 822 s 32
100 mm 204 s 32
50 mm 39 s 32
25 mm 3 s 18

Memory, commands and surfaces are unaffected: this is a test.

Testing

  • The fork's Linux gate passed on this commit: run. There the test took 75 s, where six recent runs took 666 to 1,128 s, and the last of the 12,029 tests ended as the cores ran out of work.
  • The checks each case reaches were counted at 100, 50 and 25 mm. Only the 25 mm page changes a count.

UI evidence

No visible UI change.

Related issue

None.

Summary by CodeRabbit

  • Tests
    • Updated cancellation test coverage to use a 50 × 50 mm map layout, with expected check counts clarified for 50 mm and 25 mm layouts.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The cancellation test now uses a 50 × 50 mm map page. Its comments state that this size should produce 32 cancellation checks, while a 25 mm page should produce 18.

Changes: Cancellation test

Layer / File(s) Summary
Update cancellation fixture
crates/engine/src/tests/cancellation.rs
The fixture uses a 50 × 50 mm map page. Comments record expected check counts of 32 for this size and 18 for a 25 mm page.

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

Change: Other

Suggested reviewers: elpidioassinaturas, pick2510

Merge Risk: Minimal · up to fe38a

This change only shrinks a test's PDF page to speed up the cancellation test. It has no production behavior impact and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test area and the change: the cancellation-check sweep now uses a smaller PDF page. The PR changes the test fixture from A4 to a 50 mm square page, so the title matches the main ch…
Description check Passed The description follows the template. It has a Summary that explains the change and the reason, a Testing section with the CI gate run and the counts checked, and a UI evidence section that states no …
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 test area and the change: the cancellation-check sweep now uses a smaller PDF page. The PR changes the test fixture from A4 to a 50 mm square page, so the title matches the main change. It does not mention the runtime reduction, which is the stated purpose, but the title does not need to cover every detail.

Full details: Description check

Explanation

The description follows the template. It has a Summary that explains the change and the reason, a Testing section with the CI gate run and the counts checked, and a UI evidence section that states no visible UI change. The Related issue section says None, which fills the required field.

Finishing Touches

Generate unit tests (beta)

  • 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.

Share

A rabbit checks the map with care
Fifty millimetres fill the page
Thirty-two checks hop along
Eighteen wait at twenty-five
The test now notes each count
Then bounds away to celebrate

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 3f1f2f81-6337-426a-8e55-33fc70d6ccd6
Commits

Reviewing files that changed from the base of the PR and between 8d415ca and fe38ab7.

Files selected for processing: 1

  • crates/engine/src/tests/cancellation.rs

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

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Code review

Scope: PR #3573, one file, crates/engine/src/tests/cancellation.rs (+3/−1). It changes the PDF-page fixture in the cancellation sweep from an A4 page to a 50 mm square.

Bugs

None found. I checked that layout.new documents width/height in mm, that page_size (crates/engine/src/cmd/layout.rs:567) accepts 20–5000 mm, and that the map template gets positive frame and title dimensions on a 50 mm square. The default orientation does not swap a square page. Nothing in the test changes except the page size.

Security

None. The change is test-only.

Performance

None in shipped code. The test-time reduction is the point of the PR. The author's measurements (A4 822 s, 50 mm 39 s on one machine, 32 checks retained) are plausible, but I could not run the test here, so I have not verified them.

Quality

  • Stale counts in the comment (cancellation.rs:239-240, confidence high, low severity): the "32 times" and "only 18" figures appear only in the comment. Nothing asserts them, so a change in the count would leave the comment wrong without any test failing. Posted as an inline nit.

AGENTS.md

No violations. The change adds no command, parameter or assertion, so command-surface.txt, long_commands and test-hygiene are unaffected. The "reaches every surface" and cargo xtask memory rules do not apply to a test fixture.

Twins

I checked the other entries in the same sweep. The PDF read shares the queue with the other read(...) calls in long_commands, and none of them depend on the page size. No twin needs the same change.

Prior reviews

There were no existing review threads on this PR, so I left no earlier concerns alone.

Change size

Compared with the base branch: the whole PR against main (merge base 528d57c to PR head fe38ab7).

Files changed Added Modified Removed Renamed Size before Size after Total change
1 0 1 0 0 44.4 KB 44.6 KB +197 B
Path Size before Size after Size change
crates/engine/src/tests/cancellation.rs 44.4 KB 44.6 KB +197 B

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3573/
Web app https://preview.rustgis.app/pr-3573/app/
Commit fe38ab7

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@Mavrick-F
Mavrick-F added this pull request to the merge queue Dec 2, 2026
Merged via the queue into opengeos:main with commit 9b0e3bb Dec 2, 2026
28 checks passed
@Mavrick-F
Mavrick-F deleted the test/cancel-sweep-pdf-page branch December 2, 2026 00:53
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