cros_run_unit_tests: Remove hardcoded parallelism limit

The 10 limit was introduced to prevent overloading the cbuildbot
builders. Instead of having the hard limit in the script, turn that
back up to the machine's parallelism, and move that limit to the
cbuildbot invocation of the script.

BUG=chromium:1061923
TEST=run_tests, cq

Change-Id: I13476ca20c5f285bae85cbcc4fe75e50403dffe5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2105252
Commit-Queue: Alex Klein <saklein@chromium.org>
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/cros_run_unit_tests.py b/scripts/cros_run_unit_tests.py
index 8c7999a..4bfea42 100644
--- a/scripts/cros_run_unit_tests.py
+++ b/scripts/cros_run_unit_tests.py
@@ -65,6 +65,12 @@
                            'packages that could be installed on target board '
                            'without assuming that any packages have actually '
                            'been merged yet.')
+  parser.add_argument(
+      '-j',
+      '--jobs',
+      type=int,
+      default=multiprocessing.cpu_count(),
+      help='The limit for the number of possible concurrent jobs.')
 
   options = parser.parse_args(argv)
   options.Freeze()
@@ -146,8 +152,8 @@
       return 1
 
   try:
-    chroot_util.RunUnittests(sysroot, pkg_with_test, extra_env=env,
-                             jobs=min(10, multiprocessing.cpu_count()))
+    chroot_util.RunUnittests(
+        sysroot, pkg_with_test, extra_env=env, jobs=opts.jobs)
   except cros_build_lib.RunCommandError:
     logging.error('Unittests failed.')
     return 1