{"id":13730855,"url":"https://github.com/google/gtest-parallel","last_synced_at":"2025-05-08T03:31:59.576Z","repository":{"id":17061663,"uuid":"19826356","full_name":"google/gtest-parallel","owner":"google","description":"Run Google Test suites in parallel.","archived":false,"fork":false,"pushed_at":"2024-01-16T17:50:14.000Z","size":170,"stargazers_count":434,"open_issues_count":13,"forks_count":108,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-19T22:27:23.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-15T16:13:51.000Z","updated_at":"2025-04-08T10:11:17.000Z","dependencies_parsed_at":"2023-01-11T19:30:28.204Z","dependency_job_id":"7ac397a2-22a5-41cc-9af7-b7bffbd966e7","html_url":"https://github.com/google/gtest-parallel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgtest-parallel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgtest-parallel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgtest-parallel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgtest-parallel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/gtest-parallel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252993742,"owners_count":21837292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:20.415Z","updated_at":"2025-05-08T03:31:59.262Z","avatar_url":"https://github.com/google.png","language":"Python","readme":"# gtest-parallel\n\n_This is not an official Google product._\n\n`gtest-parallel` is a script that executes [Google\nTest](https://github.com/google/googletest) binaries in parallel, providing good\nspeedup for single-threaded tests (on multi-core machines) and tests that do not\nrun at 100% CPU (on single- or multi-core machines).\n\nThe script works by listing the tests of each binary, and then executing them on\nworkers in separate processes. This works fine so long as the tests are self\ncontained and do not share resources (reading data is fine, writing to the same\nlog file is probably not).\n\n## Basic Usage\n\n_For a full list of options, see `--help`._\n\n    $ ./gtest-parallel path/to/binary...\n\nThis shards all enabled tests across a number of workers, defaulting to the\nnumber of cores in the system. If your system uses Python 2, but you have no\npython2 binary, run `python gtest-parallel` instead of `./gtest-parallel`.\n\nTo run only a select set of tests, run:\n\n    $ ./gtest-parallel path/to/binary... --gtest_filter=Foo.*:Bar.*\n\nThis filter takes the same parameters as Google Test, so -Foo.\\* can be used for\ntest exclusion as well. This is especially useful for slow tests (that you're\nnot working on), or tests that may not be able to run in parallel.\n\n## Flakiness\n\nFlaky tests (tests that do not deterministically pass or fail) often cause a lot\nof developer headache. A test that fails only 1% of the time can be very hard to\ndetect as flaky, and even harder to convince yourself of having fixed.\n\n`gtest-parallel` supports repeating individual tests (`--repeat=`), which can be\nvery useful for flakiness testing. Some tests are also more flaky under high\nloads (especially tests that use realtime clocks), so raising the number of\n`--workers=` well above the number of available core can often cause contention\nand be fruitful for detecting flaky tests as well.\n\n    $ ./gtest-parallel out/{binary1,binary2,binary3} --repeat=1000 --workers=128\n\nThe above command repeats all tests inside `binary1`, `binary2` and `binary3`\nlocated in `out/`. The tests are run `1000` times each on `128` workers (this is\nmore than I have cores on my machine anyways). This can often be done and then\nleft overnight if you've no initial guess to which tests are flaky and which\nones aren't. When you've figured out which tests are flaky (and want to fix\nthem), repeat the above command with `--gtest_filter=` to only retry the flaky\ntests that you are fixing.\n\nNote that repeated tests do run concurrently with themselves for efficiency, and\nas such they have problem writing to hard-coded files, even if they are only\nused by that single test. `tmpfile()` and similar library functions are often\nyour friends here.\n\n### Flakiness Summaries\n\nEspecially for disabled tests, you might wonder how stable a test seems before\ntrying to enable it. `gtest-parallel` prints summaries (number of passed/failed\ntests) when `--repeat=` is used and at least one test fails. This can be used to\ngenerate passed/failed statistics per test. If no statistics are generated then\nall invocations tests are passing, congratulations!\n\nFor example, to try all disabled tests and see how stable they are:\n\n    $ ./gtest-parallel path/to/binary... -r1000 --gtest_filter=*.DISABLED_* --gtest_also_run_disabled_tests\n\nWhich will generate something like this at the end of the run:\n\n    SUMMARY:\n      path/to/binary... Foo.DISABLED_Bar passed 0 / 1000 times.\n      path/to/binary... FooBar.DISABLED_Baz passed 30 / 1000 times.\n      path/to/binary... Foo.DISABLED_Baz passed 1000 / 1000 times.\n\n## Running Tests Within Test Cases Sequentially\n\nSometimes tests within a single test case use globally-shared resources\n(hard-coded file paths, sockets, etc.) and cannot be run in parallel. Running\nsuch tests in parallel will either fail or be flaky (if they happen to not\noverlap during execution, they pass). So long as these resources are only shared\nwithin the same test case `gtest-parallel` can still provide some parallelism.\n\nFor such binaries where test cases are independent, `gtest-parallel` provides\n`--serialize_test_cases` that runs tests within the same test case sequentially.\nWhile generally not providing as much speedup as fully parallel test execution,\nthis permits such binaries to partially benefit from parallel execution.\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgtest-parallel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fgtest-parallel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgtest-parallel/lists"}