[PATCH] D98179: [lit] Sort test start times based on prior test timing data

David Zarzycki via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 8 07:12:10 PST 2021


davezarzycki created this revision.
davezarzycki added reviewers: jdenny, jhenderson, yln, thopre, mehdi_amini.
davezarzycki added a project: LLVM.
Herald added subscribers: dcaballe, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, rriddle, delcypher.
davezarzycki requested review of this revision.
Herald added subscribers: stephenneuendorffer, nicolasvasilache.
Herald added a project: MLIR.

Lit as it exists today has three hacks that allow users to run tests earlier:

1. An entire test suite can set the `is_early` boolean.
2. A very recently introduced "early_tests" feature.
3. The `--incremental` flag forces failing tests to run first.

All of these approaches have problems.

1. The `is_early` feature was until very recently undocumented. Nevertheless it still lacks testing and a imprecise way of optimizing test starting times.
2. The `early_tests` feature requires manual updates and doesn't scale.
3. `--incremental` is undocumented, untested, and it requires modifying the *source* file system by "touching" the file. This "touch" based approach is arguably a hack because it confuses editors (because it looks like the test was modified behind the back of the editor) and "touching" the test source file doesn't work if the test suite is read only from the perspective of `lit` (via advanced filesystem/build tricks).

This patch attempts to simplify and address all of the above problems.

This patch formalizes, documents, tests, and defaults lit to recording the execution time of tests and then reordering all tests during the next execution. By reordering the tests, high core count machines run faster, sometimes significantly so.

This patch also always runs failing tests first, which is a positive user experience win for those that didn't know about the hidden `--incremental` flag.

Finally, if users want, they can _optionally_ commit the test timing data (or a subset thereof) back to the repository to accelerate bots and first-time runs of the test suite.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98179

Files:
  llvm/docs/CommandGuide/lit.rst
  llvm/test/Unit/lit.cfg.py
  llvm/utils/lit/lit/Test.py
  llvm/utils/lit/lit/TestingConfig.py
  llvm/utils/lit/lit/cl_arguments.py
  llvm/utils/lit/lit/discovery.py
  llvm/utils/lit/lit/formats/base.py
  llvm/utils/lit/lit/main.py
  llvm/utils/lit/tests/Inputs/early-tests/aaa.txt
  llvm/utils/lit/tests/Inputs/early-tests/bbb.txt
  llvm/utils/lit/tests/Inputs/early-tests/lit.cfg
  llvm/utils/lit/tests/Inputs/early-tests/subdir/ccc.txt
  llvm/utils/lit/tests/Inputs/reorder/.lit_test_times.txt
  llvm/utils/lit/tests/Inputs/reorder/aaa.txt
  llvm/utils/lit/tests/Inputs/reorder/bbb.txt
  llvm/utils/lit/tests/Inputs/reorder/lit.cfg
  llvm/utils/lit/tests/Inputs/reorder/subdir/ccc.txt
  llvm/utils/lit/tests/early-tests.py
  llvm/utils/lit/tests/ignore-fail.py
  llvm/utils/lit/tests/reorder.py
  llvm/utils/lit/tests/shtest-shell.py
  mlir/test/Unit/lit.cfg.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98179.329001.patch
Type: text/x-patch
Size: 14717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210308/573fd568/attachment.bin>


More information about the llvm-commits mailing list