Implement an option to control number of processes created while running tests |
||
Issue description
,
Dec 15 2017
It seems that --single-process-tests is not an option of Gtest, it's implemented in Chromium code: https://cs.chromium.org/chromium/src/base/test/launcher/unit_test_launcher.cc?q=single-process-tests&sq=package:chromium&l=53&dr=C
,
Dec 15 2017
As a hacky workaround, I can list all the tests, split them into N --gtest_filter= lists, and run it N times with --single-process-tests flag. I don't really want to do that, so keep thinking and looking into the tests launcher code.
,
Dec 15 2017
I think sharding is already baked into the binary, maybe
--test-launcher-total-shards=N
Sets the total number of shards to N.
is used for that?
btw, you mentioned that running unit_tests with --single-process-tests flag crashes, even if the tests are split into N shards, each individual shard is still using --single-process-tests, how can it help with the crash?
,
Dec 15 2017
If I ever have to do stuff proposed in c#3, I should probably do it in the launcher: https://cs.chromium.org/chromium/src/base/test/launcher/test_launcher.cc?rcl=01e526376476bf02c445e992ac7a9359f4482b29&l=917
,
Dec 15 2017
Yuke, I tried --test-launcher-total-shards=N and it doesn't help. For example: $ python testing/xvfb.py out/coverage/unit_tests --test-launcher-total-shards=2 --test-launcher-jobs=1 --gtest_filter=*WithIncidentIgnoreBypass/PreferenceValidationDelegateWithIncident* There are 24 tests from 4 testcases that match the filter I specified. As a result, there always are 4 coverage dumps unless I use --single-process-tests flag.
,
Dec 15 2017
>> btw, you mentioned that running unit_tests with --single-process-tests flag crashes, even if the tests are split into N shards, each individual shard is still using --single-process-tests, how can it help with the crash? Let me try that, launched with 200 shards and --single-process-tests.
,
Dec 15 2017
Nope, still crashes.
,
Dec 15 2017
Right, looks like the binary ignores --test-launcher-total-shards flag, as in the output "Using sharding settings from environment. This is shard 0/1", but given that each individual shard needs to use --single-process-tests anyway, I guess this won't help. liaoyuke@liaoyuke-macpro src (master) $ ./out/Coverage/url_unittests --test-launcher-total-shards=5 IMPORTANT DEBUGGING NOTE: batches of tests are run inside their own process. For debugging a test inside a debugger, use the --gtest_filter=<your_test_name> flag along with --single-process-tests. Using sharding settings from environment. This is shard 0/1 Using 24 parallel jobs.
,
Dec 15 2017
Yes :( Even running in a single process could be OK, but I' always have some CHECK's failing or null deref crashes, so that process cannot finish successfully.
,
Jan 10 2018
The idea proposed here wouldn't work for us anyway, WontFix'ing this. Let's continue discussion in issue 789733 . |
||
►
Sign in to add a comment |
||
Comment 1 by mmoroz@chromium.org
, Dec 15 2017