Fuzz: exercise the selected region in FormatOutOfCountryCallingNumber, cap manual duration - #429
Merged
Merged
Conversation
…, cap manual duration Two coverage/UX gaps from the aggressive v9.0.37..main re-review, not correctness bugs (this project isn't shipped in the NuGet package): - FormatOutOfCountryCallingNumber was always fuzzed with a hardcoded "US" calling region, so formatting-from-region-specific branches (e.g. a region sharing the parsed number's country code, or with unusual national-prefix/IDD rules) got zero coverage no matter how long the fuzzer ran. It now reuses the same fuzzer-selected region already threaded through Parse/FindNumbers/FormatAsYouType. Verified: existing corpus still passes clean, plus a spread of region-selector bytes (0, 1, 50, 100, 150, 200, 250, 255) all format without throwing. - workflow_dispatch's `duration` input (seconds) had no upper bound against the job's 60-minute timeout. An oversized value doesn't make libFuzzer stop later - it makes the runner hard-cancel the job instead, which skips "Upload crashes" (only runs on `failure()`, not on a cancellation) and loses whatever crash was found. Capped to 3000s (50 min), leaving headroom for checkout/build/instrument/upload. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WVGRJyQwtvBGXAmWswxyqW
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #429 +/- ##
=======================================
Coverage 87.26% 87.26%
=======================================
Files 41 41
Lines 3831 3831
Branches 978 978
=======================================
Hits 3343 3343
Misses 284 284
Partials 204 204 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Aug 28, 2026
Closed
Open
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Two coverage/UX gaps from the aggressive
v9.0.37..mainre-review — not correctness bugs in the shipped library (PhoneNumbers.Fuzzisn't part of the packed NuGet package).csharp/PhoneNumbers.Fuzz/Program.cs:FormatOutOfCountryCallingNumberwas always fuzzed with a hardcoded"US"calling region, so formatting-from-region-specific branches (a region sharing the parsed number's country code, or with unusual national-prefix/IDD rules) got zero coverage regardless of how long the fuzzer ran. It now reuses the same fuzzer-selected region already threaded throughParse/FindNumbers/FormatAsYouType..github/workflows/fuzz.yml: theworkflow_dispatchdurationinput (seconds) had no upper bound against the job's 60-minutetimeout-minutes. An oversized manual value doesn't make libFuzzer stop later — it makes the runner hard-cancel the whole job instead, which skips the "Upload crashes" step (if: failure()doesn't fire on a cancellation) and loses whatever crash was found. Capped to 3000s (50 min) viamin(fromJSON(...), 3000), leaving headroom for checkout/build/instrument/upload within the 60-minute budget.Test plan
dotnet build csharp/PhoneNumbers.Fuzz -c Release— clean, 0 warnings.FormatOutOfCountryCallingNumber— all format without throwing.