Fix fuzz_repo
False Positive With a Refactor to Improve Effectiveness & Efficiency
#1317
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.
Sorry for the churn on this test; filesystem I/O makes for slow feedback when trying to test locally.
Anyway, the issues listed below are addressed in this PR by simplifying the test harness implementation. The result being significantly improved fuzzing coverage and slightly improved execution speed.
Prior to the changes introduced here, the implementation of
fuzz_repo
had several issues:repo.stage()
was not called before the firstrepo.do_commit()
callrepo.stage()
was eventually called, the argument it was passed was incorrect (a list of absolute paths instead of relative to the repo dir) causing aValueError
that broke the fuzzer runs. This was hidden during the initial local testing because of point 3 below.TestOneInput
execution until the fuzzer was able to generate a corpus large enough to satisfy all of theConsume*
calls.Other changes:
EnhancedFuzzedDataProvider.ConsumeRandomString
now accepts an argument to optionally exclude unicode surrogates from the returned string (useful for places where they will always raise an exception like most filesystem operations.)Closes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69054