Repository: pantsbuild/pants

Issue:
--coverage-py-global-report fails for > ~10 test files
It looks like this:
```
$ ./pants test --use-coverage --coverage-py-global-report src/python/pants/util/::
07:24:03.92 [INFO] Completed: test - src/python/pants/util/contextutil_test.py:tests succeeded.
07:24:03.92 [INFO] Completed: test - src/python/pants/util/dirutil_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/filtering_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/enums_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/osutil_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/collections_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/memo_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/eval_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/meta_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/socket_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/ordered_set_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/strutil_test.py:tests succeeded.
07:24:03.93 [INFO] Completed: test - src/python/pants/util/frozendict_test.py:tests succeeded.

✓ src/python/pants/util/collections_test.py:tests succeeded.
✓ src/python/pants/util/contextutil_test.py:tests succeeded.
✓ src/python/pants/util/dirutil_test.py:tests succeeded.
✓ src/python/pants/util/enums_test.py:tests succeeded.
✓ src/python/pants/util/eval_test.py:tests succeeded.
✓ src/python/pants/util/filtering_test.py:tests succeeded.
✓ src/python/pants/util/frozendict_test.py:tests succeeded.
✓ src/python/pants/util/memo_test.py:tests succeeded.
✓ src/python/pants/util/meta_test.py:tests succeeded.
✓ src/python/pants/util/ordered_set_test.py:tests succeeded.
✓ src/python/pants/util/osutil_test.py:tests succeeded.
✓ src/python/pants/util/socket_test.py:tests succeeded.
✓ src/python/pants/util/strutil_test.py:tests succeeded.
07:24:04.30 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/bin/local_pants_runner.py", line 234, in _run_inner
    return self._perform_run(goals)
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/bin/local_pants_runner.py", line 173, in _perform_run
    return self._perform_run_body(goals, poll=False)
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/bin/local_pants_runner.py", line 195, in _perform_run_body
    poll_delay=(0.1 if poll else None),
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/init/engine_initializer.py", line 136, in run_goal_rules
    goal_product, params, poll=poll, poll_delay=poll_delay
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/internals/scheduler.py", line 530, in run_goal_rule
    self._raise_on_error([t for _, t in throws])
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/internals/scheduler.py", line 494, in _raise_on_error
    wrapped_exceptions=tuple(t.exc for t in throws),

Exception message: 1 Exception encountered:

Engine traceback:
  in select
  in pants.core.goals.test.run_tests
  in pants.backend.python.goals.coverage_py.generate_coverage_reports
  in pants.backend.python.goals.coverage_py.merge_coverage_data
Traceback (most recent call last):
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/internals/selectors.py", line 654, in native_engine_generator_send
    res = func.send(arg)
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/backend/python/goals/coverage_py.py", line 410, in merge_coverage_data
    *coverage_digest_gets,
TypeError: MultiGet() takes from 1 to 10 positional arguments but 14 were given

Traceback (most recent call last):
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/bin/local_pants_runner.py", line 234, in _run_inner
    return self._perform_run(goals)
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/bin/local_pants_runner.py", line 173, in _perform_run
    return self._perform_run_body(goals, poll=False)
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/bin/local_pants_runner.py", line 195, in _perform_run_body
    poll_delay=(0.1 if poll else None),
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/init/engine_initializer.py", line 136, in run_goal_rules
    goal_product, params, poll=poll, poll_delay=poll_delay
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/internals/scheduler.py", line 530, in run_goal_rule
    self._raise_on_error([t for _, t in throws])
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/internals/scheduler.py", line 494, in _raise_on_error
    wrapped_exceptions=tuple(t.exc for t in throws),
pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:

Engine traceback:
  in select
  in pants.core.goals.test.run_tests
  in pants.backend.python.goals.coverage_py.generate_coverage_reports
  in pants.backend.python.goals.coverage_py.merge_coverage_data
Traceback (most recent call last):
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/internals/selectors.py", line 654, in native_engine_generator_send
    res = func.send(arg)
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/backend/python/goals/coverage_py.py", line 410, in merge_coverage_data
    *coverage_digest_gets,
TypeError: MultiGet() takes from 1 to 10 positional arguments but 14 were given
```


Discussion:

Resolving patch:
diff --git a/src/python/pants/backend/python/goals/coverage_py.py b/src/python/pants/backend/python/goals/coverage_py.py
--- a/src/python/pants/backend/python/goals/coverage_py.py
+++ b/src/python/pants/backend/python/goals/coverage_py.py
@@ -408,18 +408,16 @@ async def merge_coverage_data(
                 level=LogLevel.DEBUG,
             ),
         )
-        coverage_digests = await MultiGet(
+        coverage_digest_gets.append(
             Get(
                 Digest, AddPrefix(digest=result.output_digest, prefix=str(global_coverage_base_dir))
-            ),
-            *coverage_digest_gets,
+            )
         )
         coverage_data_file_paths.append(str(global_coverage_base_dir / ".coverage"))
-        input_digest = await Get(Digest, MergeDigests(coverage_digests))
     else:
         extra_sources_digest = EMPTY_DIGEST
-        input_digest = await Get(Digest, MergeDigests(await MultiGet(coverage_digest_gets)))
 
+    input_digest = await Get(Digest, MergeDigests(await MultiGet(coverage_digest_gets)))
     result = await Get(
         ProcessResult,
         VenvPexProcess(


Test patch: