Skip to content

Make the PDFDataRangeTransport streaming unit-tests faster#21238

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
Snuffleupagus:PDFDataRangeTransport-unittest-faster
May 10, 2026
Merged

Make the PDFDataRangeTransport streaming unit-tests faster#21238
timvandermeij merged 1 commit into
mozilla:masterfrom
Snuffleupagus:PDFDataRangeTransport-unittest-faster

Conversation

@Snuffleupagus
Copy link
Copy Markdown
Collaborator

@Snuffleupagus Snuffleupagus commented May 8, 2026

The delay between chunks when testing streaming is necessary to avoid the entire PDF document arriving all at once, since that would render those unit-tests somewhat pointless.
However, the delay is unnecessarily large which causes these unit-tests to be slower than necessary.

Also, update the range unit-tests to check the expected number of fetches exactly since those values are not supposed to vary.


Note: This reduces the runtime of the should fetch document info and page using only streaming unit-test by 1200 ms.

The delay between chunks when testing streaming is necessary to avoid the entire PDF document arriving all at once, since that would render those unit-tests somewhat pointless.
However, the delay is unnecessarily large which causes these unit-tests to be slower than necessary.

Also, update the range unit-tests to check the expected number of fetches *exactly* since those values are not supposed to vary.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.99%. Comparing base (e86e9d9) to head (1592124).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21238      +/-   ##
==========================================
+ Coverage   54.57%   55.99%   +1.42%     
==========================================
  Files         216      220       +4     
  Lines       58860    58964     +104     
==========================================
+ Hits        32120    33016     +896     
+ Misses      26740    25948     -792     
Flag Coverage Δ
unittest 55.32% <ø> (?)
unittestcli 54.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timvandermeij timvandermeij merged commit 33a6f3e into mozilla:master May 10, 2026
14 checks passed
@timvandermeij
Copy link
Copy Markdown
Contributor

Nice find; thank you for speeding up the tests!

@Snuffleupagus Snuffleupagus deleted the PDFDataRangeTransport-unittest-faster branch May 10, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants