Skip to content
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

🎨 De-hypothesize regression test #4616

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

sergei-maertens
Copy link
Member

The original reason failures happened was because the form name was used to construct the file name of the PDF, which resulted in nested paths with forward slashes.

The ambition with hypothesis was nice - whatever form name you specify should not result in broken file saving, but hypothesis comes up with some very exotic unicode characters that font libraries and/or weasyprint sometimes cannot handle. These edge cases are not worth fixing or mitigating with fancy input validating restricting the unicode range of valid characters, but we also do not want these flaky test failures.

The test is rewritten without hypothesis to illustrate the original failure, preventing similar further regressions. If the edge cases do happen for real, we'll have a stakeholder funding the extra mitigations needed.

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.68%. Comparing base (975f9ca) to head (911ec28).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4616   +/-   ##
=======================================
  Coverage   96.68%   96.68%           
=======================================
  Files         732      732           
  Lines       24610    24610           
  Branches     3227     3227           
=======================================
  Hits        23793    23793           
  Misses        564      564           
  Partials      253      253           

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

The original reason failures happened was because the form name was
used to construct the file name of the PDF, which resulted in nested
paths with forward slashes.

The ambition with hypothesis was nice - whatever form name you specify
should not result in broken file saving, but hypothesis comes up with
some very exotic unicode characters that font libraries and/or
weasyprint sometimes cannot handle. These edge cases are not worth
fixing or mitigating with fancy input validating restricting the
unicode range of valid characters, but we also do not want these
flaky test failures.

The test is rewritten without hypothesis to illustrate the original
failure, preventing similar further regressions. If the edge cases
do happen for real, we'll have a stakeholder funding the extra
mitigations needed.
@sergei-maertens sergei-maertens force-pushed the chore/test-cleanups-to-avoid-flakiness branch from da55351 to 911ec28 Compare August 22, 2024 17:16
@sergei-maertens sergei-maertens merged commit 9e4f2cf into master Aug 22, 2024
34 checks passed
@sergei-maertens sergei-maertens deleted the chore/test-cleanups-to-avoid-flakiness branch August 22, 2024 17:55
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