Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shuffle test order and repeat test runs once. (flutter#12275)
The tests we write must be resilient to the order in which they are run in the harness. That is, they must not rely on global state set by other tests that have already run in the process. Also, these tests must themselves be repeatable. That is, they must correctly clean up after themselves and be able to run successfully again in the same process. This patch adds some safeguards against (but does NOT guarantee) the addition of tests that violate the dictum. Additionally, test failures must be easily reproducible for folks investigating the test failure. Also, tests that assert correctness of unrelated code must not stop progress on the authors patch. This changes does not hinder reproducibility of test failures because the random seed is printed in the logs before running each test. Developers attempting to reproduce the failure locally can do the same via the following invocation `--gtest_shuffle --gtest_repeat=<the count> --gtest_random_seed=<seed from failing run>`. This change does introduce potential burden on patch authors that may see failures in unrelated code as a newly failing shuffle seed is used on their runs. To ameliorate this, we will formulate guidance for them to aggressively mark such tests as disabled and file bugs to enable the same. The test seed is intentionally kept low because it’s purpose is to test that individual tests are repeatable. It must not be used as a replacement for fuzzing.
- Loading branch information