New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 795314 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 789733



Sign in to add a comment

Implement an option to control number of processes created while running tests

Project Member Reported by mmoroz@chromium.org, Dec 15 2017

Issue description

Comment 1 by mmoroz@chromium.org, Dec 15 2017

Blocking: 789733

Comment 2 by mmoroz@chromium.org, 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


Comment 3 by mmoroz@chromium.org, 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.
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?

Comment 5 by mmoroz@chromium.org, 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


Comment 6 by mmoroz@chromium.org, 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.

Comment 7 by mmoroz@chromium.org, 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.

Comment 8 by mmoroz@chromium.org, Dec 15 2017

Nope, still crashes.
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.


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.
Status: WontFix (was: Untriaged)
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