2010YOUY01 opened a new pull request, #27048: URL: https://github.com/apache/datafusion/pull/27048
> [!IMPORTANT] > > **Fork CI setup:** For pull requests from a fork to `main`, enable workflows in your fork's **Actions** tab before you push. > See the [fork CI setup guide](https://datafusion.apache.org/contributor-guide/#pull-requests-from-forks). ## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## Rationale for this change Fuzz tests should follow these conventions: - Time budgets are configurable: each test case takes several milliseconds, and the driver can run on a best-effort basis within a budget such as one minute. - Each test case can be reproduced from a seed. - The starting seed varies across runs to broaden coverage over time. Most of the existing implementations don't follow all of these principles, or implemented it with unnecessary complexity: - Some individual fuzz unit tests take five minutes to run. - Some use environment variables for configuration. - Some use fixed seeds across runs. - Failures are hard to reproduce. Refactoring to a shared trait can prevent these issues in the future. This PR introduces a trait to enforce these conventions and migrates one fuzz unit test to use it. Other existing fuzzers remain available for later migration. ### Demo ``` -- Runs all fuzzing UTs (now only 1 test refactored in this PR) cargo xtask ci step test fuzz ``` ## What changes are included in this PR? Read the key changes in the following order; the remaining changes are minor. 1. `FuzzTest` in `test-utils/src/fuzz.rs`: a trait that ensures all fuzz tests follow the intended conventions. 2. `Suite` in `datafusion/fuzz/tests/fuzz.rs`: a single entry point for all fuzz unit tests in DataFusion. 3. `SpillPoolFuzzer` in `datafusion/fuzz/tests/suites/spill_pool.rs`: the first unit test migrated to the centralized `FuzzTest` trait and unified runner. 4. Update CI to run this fuzz test suite separately. The key API is in step 1. I've implemented several fuzz tests, and I think this design is reasonable. I also asked Codex to verify that all existing fuzz tests can be migrated to this trait. Step 2: using a unified test entry point make it easier to configure fuzzing time in the future. For example it's possible to deploy a long-running background fuzzing job. ## What is the testing strategy for this PR? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code Briefly describe how this PR is tested, and point to the specific tests you added. For example: 'This new feature is covered by the `sqllogictest` cases added in `foo.slt`'. If this PR does not add tests, explain why. For example, if the change is already covered by existing tests, please mention it. You should also check the `codecov` bot reply on this PR to confirm the changed code is exercised. --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please add the `api change` label. --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
