git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git in Outreachy December 2019?

From
Jeff King <peff@peff.net>
Date
Sep 17, 2019, 00:59 UTC
Message-ID
<20190917005928.GA27926@sigill.intra.peff.net>
In-Reply-To
<20190916231348.GB67467@google.com>
On Mon, Sep 16, 2019 at 04:13:49PM -0700, Jonathan Nieder wrote:
Show 21 quoted lines
> Most tests use "setup" or "set up" in the names of test assertions
> that are required by later tests.  It's very helpful for debugging and
> maintenance to be able to skip or reorder some tests, so I've been
> able to rely on this a bit.  Of course there's no automated checking
> in place for that, so there are plenty of test scripts that are
> exceptions to it.
> 
> If we introduce a test_setup helper, then we would not have to rely on
> convention any more.  A test_setup test assertion would represent a
> "barrier" that all later tests in the file can rely on.  We could
> introduce some automated checking that these semantics are respected,
> and then we get a maintainability improvement in every test script
> that uses test_setup.  (In scripts without any test_setup, treat all
> test assertions as barriers since they haven't been vetted.)
> 
> With such automated tests in place, we can then try updating all tests
> that say "setup" or "set up" to use test_setup and see what fails.
> 
> Some other tests cannot run in parallel for other reasons (e.g. HTTP
> tests).  These can be declared as such, and then we have the ability
> to run arbitrary individual tests in parallel.

This isn't quite the same, but couldn't we get most of the gain just by splitting the tests into more scripts? As you note, we already run those in parallel, so it increases the granularity of our parallelism. And you don't have to worry about skipping tests 1 through 18 if they're in another file; you just don't consider them at all. It also Just Works with things like HTTP, which choose ports under the assumption that the other tests are running simultaneously.

It doesn't help with the case that test 1 does setup, and then tests 2, 3, and 4 are logically independent (and some could be skipped or not).

If anybody is interested in splitting up scripts, the obvious ones to look at are the ones that take the longest (t9001 takes 55s on my system, though the whole suite runs in only 95s). Of course you can get most of the parallelism benefit by using "prove --state=slow,save", which ends up with lots of short scripts at the end (rather than one slow one chewing one CPU while the rest sit idle).

> Most of the time in a test run involves multiple test scripts running
> in parallel already, so this isn't a huge win for the time to complete
> a normal test run.  It helps more with expensive runs like --valgrind.
Two easier suggestions than trying to make --valgrind faster:
  - use SANITIZE=address, which is way cheaper than valgrind (and
    catches more things!)
  - use --valgrind-only=17 to run everything else in "fast" mode, but
    check the test you care about
-Peff
Previous: Jonathan NiederNext: Johannes Schindelin
Message 24 of 63 in “Git in Outreachy December 2019?”
  1. Jeff KingAug 27, 2019
  2. Christian CouderAug 31, 2019
  3. Olga TelezhnayaAug 31, 2019
  4. Jeff KingSep 4, 2019
  5. Christian CouderSep 5, 2019
  6. Emily ShafferSep 5, 2019
  7. Carlo ArenasSep 6, 2019
  8. Jeff KingSep 7, 2019
  9. Carlo ArenasSep 7, 2019
  10. Jeff KingSep 7, 2019
  11. Pratyush YadavSep 8, 2019
  12. Jeff KingSep 9, 2019
  13. SZEDER GáborSep 23, 2019
  14. SZEDER GáborSep 26, 2019
  15. Johannes SchindelinSep 26, 2019
  16. SZEDER GáborSep 26, 2019
  17. Johannes SchindelinSep 26, 2019
  18. Jonathan TanSep 13, 2019
  19. Jeff KingSep 13, 2019
  20. Emily ShafferSep 16, 2019
  21. Eric WongSep 16, 2019
  22. SZEDER GáborSep 16, 2019
  23. Jonathan NiederSep 16, 2019
  24. Jeff KingSep 17, 2019
  25. Johannes SchindelinSep 17, 2019
  26. SZEDER GáborSep 17, 2019
  27. Johannes SchindelinSep 23, 2019
  28. SZEDER GáborSep 23, 2019
  29. Johannes SchindelinSep 26, 2019
  30. SZEDER GáborSep 26, 2019
  31. Johannes SchindelinSep 26, 2019
  32. SZEDER GáborSep 26, 2019
  33. Jeff KingSep 27, 2019
  34. SZEDER GáborOct 9, 2019
  35. Jeff KingOct 11, 2019
  36. Jeff KingSep 23, 2019
  37. Johannes SchindelinSep 24, 2019
  38. Christian CouderSep 17, 2019
  39. Johannes SchindelinSep 23, 2019
  40. Jeff KingSep 23, 2019
  41. Jeff KingSep 23, 2019
  42. Johannes SchindelinSep 24, 2019
  43. Jeff KingSep 24, 2019
  44. Junio C HamanoSep 28, 2019
  45. Eric WongSep 24, 2019
  46. Johannes SchindelinSep 26, 2019
  47. Eric WongSep 30, 2019
  48. Junio C HamanoSep 28, 2019
  49. Jonathan TanSep 20, 2019
  50. Emily ShafferSep 21, 2019
  51. Christian CouderSep 23, 2019
  52. Jeff KingSep 23, 2019
  53. Philip OakleySep 23, 2019
  54. Emily ShafferOct 22, 2019
  55. Christian CouderSep 23, 2019
  56. Jonathan TanSep 23, 2019
  57. Jeff KingSep 23, 2019
  58. Jonathan TanSep 23, 2019
  59. Jeff KingSep 23, 2019
  60. Jonathan TanSep 23, 2019
  61. Jeff KingSep 23, 2019
  62. Jonathan TanSep 24, 2019
  63. Jeff KingSep 26, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.