Skip to content

Run pytests in parallel (-n 2) on Travis#6915

Merged
yarikoptic merged 3 commits into
datalad:maintfrom
yarikoptic:enh-parallel-pytest
Aug 26, 2022
Merged

Run pytests in parallel (-n 2) on Travis#6915
yarikoptic merged 3 commits into
datalad:maintfrom
yarikoptic:enh-parallel-pytest

Conversation

@yarikoptic
Copy link
Copy Markdown
Member

@yarikoptic yarikoptic commented Aug 3, 2022

[appveyor skip]

It seems to cut down total run time for tests from ~6h10m to ~4h40m so about 20% run time cut. IMHO worthwhile and thus taking it from draft

image

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 3, 2022

Codecov Report

Merging #6915 (01de4a4) into maint (4ecffe8) will increase coverage by 1.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            maint    #6915      +/-   ##
==========================================
+ Coverage   89.97%   91.11%   +1.13%     
==========================================
  Files         354      354              
  Lines       46261    46327      +66     
  Branches        0     6613    +6613     
==========================================
+ Hits        41624    42211     +587     
+ Misses       4637     4100     -537     
- Partials        0       16      +16     
Impacted Files Coverage Δ
datalad/core/distributed/tests/test_push.py 98.73% <100.00%> (-0.21%) ⬇️
datalad/_version.py 45.68% <0.00%> (-0.28%) ⬇️
datalad/dataset/gitrepo.py 96.81% <0.00%> (ø)
datalad/distributed/tests/test_drop.py 100.00% <0.00%> (ø)
datalad/distributed/create_sibling_ria.py 84.11% <0.00%> (ø)
datalad/tests/test_utils.py 97.53% <0.00%> (+0.01%) ⬆️
datalad/distributed/drop.py 97.70% <0.00%> (+0.02%) ⬆️
datalad/support/annexrepo.py 90.52% <0.00%> (+0.08%) ⬆️
datalad/distribution/tests/test_create_sibling.py 79.83% <0.00%> (+0.17%) ⬆️
... and 15 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@yarikoptic
Copy link
Copy Markdown
Member Author

yarikoptic commented Aug 4, 2022

FWIW -n 4 is clearly too much:

$> grep ' passed' *.txt
1.txt:= 1 failed, 1248 passed, 57 skipped, 4 xfailed, 8 warnings in 1930.70s (0:32:10) =
2.txt:= 1 failed, 1248 passed, 57 skipped, 4 xfailed, 8 warnings in 1918.76s (0:31:58) =
3.txt:= 3 failed, 1244 passed, 58 skipped, 4 xfailed, 8 warnings in 3185.50s (0:53:05) =
4.txt:= 4 failed, 1243 passed, 58 skipped, 4 xfailed, 8 warnings in 3105.58s (0:51:45) =
5.txt:Test passed but took too long to run: Duration 33.65450800100001s > 30.0s
5.txt:Test passed but took too long to run: Duration 68.18886611000005s > 30.0s
5.txt:Test passed but took too long to run: Duration 34.622367728000086s > 30.0s
5.txt:Test passed but took too long to run: Duration 46.49323160800009s > 30.0s
5.txt:Test passed but took too long to run: Duration 59.21096332399998s > 30.0s
5.txt:Test passed but took too long to run: Duration 55.278426190999994s > 30.0s
5.txt:Test passed but took too long to run: Duration 40.250691093s > 30.0s
5.txt:Test passed but took too long to run: Duration 42.66228332900005s > 30.0s
5.txt:Test passed but took too long to run: Duration 59.447907825000016s > 30.0s
5.txt:Test passed but took too long to run: Duration 43.065122439000106s > 30.0s
5.txt:Test passed but took too long to run: Duration 41.31802824900001s > 30.0s
5.txt:Test passed but took too long to run: Duration 30.760146550999934s > 30.0s
5.txt:Test passed but took too long to run: Duration 59.341763300000025s > 30.0s
5.txt:Test passed but took too long to run: Duration 30.14886795999996s > 30.0s
5.txt:Test passed but took too long to run: Duration 33.295477595999955s > 30.0s
5.txt:Test passed but took too long to run: Duration 53.39344802300002s > 30.0s
5.txt:Test passed but took too long to run: Duration 33.28909159600005s > 30.0s
5.txt:Test passed but took too long to run: Duration 35.50646775100006s > 30.0s
5.txt:= 18 failed, 1133 passed, 50 skipped, 3 xfailed, 7 warnings in 1033.86s (0:17:13) =
8.txt:Test passed but took too long to run: Duration 67.22365210499999s > 30.0s
8.txt:Test passed but took too long to run: Duration 39.17100284200001s > 30.0s
8.txt:Test passed but took too long to run: Duration 50.01524455399999s > 30.0s
8.txt:Test passed but took too long to run: Duration 62.08500265400005s > 30.0s
8.txt:Test passed but took too long to run: Duration 58.96374498500006s > 30.0s
8.txt:Test passed but took too long to run: Duration 41.764372616999935s > 30.0s
8.txt:Test passed but took too long to run: Duration 43.930414835999954s > 30.0s
8.txt:Test passed but took too long to run: Duration 60.77222200799997s > 30.0s
8.txt:Test passed but took too long to run: Duration 38.71943453099993s > 30.0s
8.txt:Test passed but took too long to run: Duration 41.795034137000016s > 30.0s
8.txt:Test passed but took too long to run: Duration 30.119838873999925s > 30.0s
8.txt:Test passed but took too long to run: Duration 57.79002824199995s > 30.0s
8.txt:Test passed but took too long to run: Duration 30.89522777100001s > 30.0s
8.txt:Test passed but took too long to run: Duration 35.141321757000014s > 30.0s
8.txt:Test passed but took too long to run: Duration 37.58187771400003s > 30.0s
8.txt:Test passed but took too long to run: Duration 55.97734738500003s > 30.0s
8.txt:Test passed but took too long to run: Duration 32.08144359500011s > 30.0s
8.txt:= 17 failed, 1137 passed, 45 skipped, 3 xfailed, 7 warnings in 991.16s (0:16:31) =

so there is a few legit fails but then the rest is due to overcomitting tests start to exceed their allowances.

$> grep -h '^FAILED' 1.txt 2.txt 3.txt 4.txt | sort | uniq -c
      2 FAILED ../cli/tests/test_parser.py::test_setup - AssertionError: assert '.' i...
      1 FAILED ../datalad/support/tests/test_parallel.py::test_gracefull_death - asse...
      1 FAILED ../datalad/tests/test_cmd.py::test_batched_close_timeout_exception - s...
      2 FAILED ../support/tests/test_external_versions.py::test_external_versions_basic
      1 FAILED ../support/tests/test_parallel.py::test_gracefull_death - assert 0 >= 2
      2 FAILED ../tests/test_installed.py::test_run_datalad_help - assert ["[WARNING]..

As initial check with -n4 showed -- was too much, many tests started to exceed
their time limits
@yarikoptic yarikoptic force-pushed the enh-parallel-pytest branch from 964b1f4 to f3121e5 Compare August 18, 2022 12:54
@yarikoptic yarikoptic changed the title Run pytests in parallel (-n 4) on CI (travis ATM) Run pytests in parallel (-n 2) on CI (travis ATM) Aug 20, 2022
@yarikoptic yarikoptic added the semver-tests Changes only affect tests, no impact on version label Aug 24, 2022
@yarikoptic yarikoptic marked this pull request as ready for review August 24, 2022 12:49
@yarikoptic yarikoptic changed the title Run pytests in parallel (-n 2) on CI (travis ATM) Run pytests in parallel (-n 2) on Travis Aug 24, 2022
@yarikoptic
Copy link
Copy Markdown
Member Author

ok, I guess nobody cares about travis enough, I will meanwhile merge this one and propose similar one for appveyor

@yarikoptic yarikoptic merged commit 4d374f3 into datalad:maint Aug 26, 2022
yarikoptic added a commit to yarikoptic/datalad that referenced this pull request Aug 26, 2022
@github-actions
Copy link
Copy Markdown

🚀 PR was released in 0.17.4 🚀

christian-monch pushed a commit to christian-monch/datalad that referenced this pull request Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released semver-tests Changes only affect tests, no impact on version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant