fish-shell/cmake
Joel Rosdahl 76b6959cad Fix parallel build race condition for test targets
When executing “make test -jX” (with X > 1) to build and run tests in a
build directory, there is a race condition between the
serial_test_low_level target and the test_prep target (a dependency of
serial_test_fishscript and serial_test_interactive).

As far as I can tell, these events happen in a serial build scenario
(“make test” with the “Unix Makefiles” CMake generator):

  1. The fish_tests binary is built and executed.
  2. The test_prep target (a dependency of serial_test_fishscript)
     cleans up test directories.
  3. Tests in test.fish are executed.

In a parallel build scenario, this often happens:

  1. Build of the fish_tests binary is started.
  2. The test_prep target cleans up test directories.
  3. Build of the fish_tests binary is finished.
  4. Execution of the fish_tests binary starts.
  5. Execution of the fish_tests binary finishes.
  6. Tests in test.fish are executed.

However, if building the fish_tests binary is fast enough but not
instant (e.g. when using ccache), this can happen:

  1. Build of the fish_tests binary is started.
  2. Build of the fish_tests binary is finished.
  3. Execution of the fish_tests binary starts.
  4. The test_prep target cleans up test directories.
  5. fish_tests tests that depend on said test directories may,
     depending on timing, fail because they are wiped by test_prep.

Fix this by making test_prep a dependency of serial_test_low_level so
that test_prep can’t interfere with fish_tests execution.
2021-03-09 21:49:52 +01:00
..
checks Optimize away a str2wcs_internal check 2020-09-07 18:05:18 -05:00
Benchmark.cmake Use lowercase CMake function names 2020-03-14 16:11:35 -07:00
CheckIncludeFiles.cmake cmake: update CheckIncludeFiles to enable C++ checks 2017-11-17 16:21:56 +08:00
ConfigureChecks.cmake Support both GCC's Wno-redundant-move and LLVM's Wredundant-move 2021-02-22 15:44:17 -06:00
Docs.cmake cmake: Stop copying css files 2021-03-02 17:04:47 +01:00
gettext.cmake Mark Intl cmake package as quiet 2020-06-06 18:56:54 -07:00
Install.cmake Update some .md references 2020-05-30 10:07:21 +02:00
Mac.cmake Suppress linker warnings in Mac debug builds 2020-09-27 11:35:16 -07:00
MacApp.cmake Use lowercase CMake function names 2020-03-14 16:11:35 -07:00
PCRE2.cmake Add CMake variable FISH_USE_SYSTEM_PCRE2 2020-04-28 18:30:40 -07:00
Tests.cmake Fix parallel build race condition for test targets 2021-03-09 21:49:52 +01:00
Version.cmake Use lowercase CMake function names 2020-03-14 16:11:35 -07:00