1996fanrui opened a new pull request, #27917: URL: https://github.com/apache/flink/pull/27917
## What is the purpose of the change Fix `PseudoRandomValueSelector.randomize()` producing identical values for all boolean config options within a single test. ## Problem All boolean config options always get the **same** value within a single test — either all `true` or all `false`: ``` Randomly selected true for execution.checkpointing.unaligned.recover-output-on-downstream.enabled Randomly selected true for execution.checkpointing.unaligned.during-recovery.enabled Randomly selected true for execution.checkpointing.cleaner.parallel-mode Randomly selected true for execution.checkpointing.unaligned.interruptible-timers.enabled Randomly selected true for execution.checkpointing.snapshot-compression Randomly selected true for execution.checkpointing.file-merging.enabled Randomly selected true for state.backend.rocksdb.use-ingest-db-restore-mode ``` This reduces test coverage since many configuration combinations are never tested. ## Root Cause [`randomize()`](https://github.com/apache/flink/blob/master/flink-runtime/src/test/java/org/apache/flink/runtime/testutils/PseudoRandomValueSelector.java#L128-L133) creates a new `java.util.Random` with the same seed (commit hash + test name) for every call. Since `new Random(seed).nextInt(2)` is deterministic, all boolean options get identical results. Introduced in [`bad18ed9aea`](https://github.com/apache/flink/commit/bad18ed9aea361836a1c49adefb4a306590419e8) ([FLINK-21448]), which replaced a shared `PseudoRandomValueSelector` instance with repeated static `randomize()` calls. ## Fix Include the config option key in the seed so each option gets a different seed, ensuring different boolean config options are independently randomized while preserving reproducibility. ## Verifying this change New test `testRandomizeDifferentOptionsProduceDifferentValues` verifies that different config options produce different values. ## Does this pull request potentially affect one of the following parts - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn, Mesos, Kubernetes, ZooKeeper: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? no - If yes, how is the feature documented? not applicable -- 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]
