Change:
Haven't had time to debug, but just recording here.
Got the same issue here, the root cause is that in On BSD, the -I option has constraint of 255 bytes limit, so the arguments got truncated. This did not happen on Linux as GNU has no such limitation. -I replstr Execute utility for each input line, replacing one or more occur- rences of replstr in up to replacements (or 5 if no -R flag is specified) arguments to utility with the entire line of input. The resulting arguments, after replacement is done, will not be allowed to grow beyond 255 bytes; this is implemented by concate- nating as much of the argument containing replstr as possible, to the constructed arguments to utility, up to 255 bytes. One solution is to extract the bash call command to a function, likely to be , and change the code to something like all parameters need to be passed in to the function, still considering on how to optimize the call.
we have to put the newfunc somewhere rather than test-, is a candidate, as the script need to be sourced before the function call is available. and test- can not be source. Another option is to drop the xargs call, a function named runTestIterations is in test-, which is called when coverage is not enabled, evaluating the possibility of adapting this function.
The other problem with this solutions is the hugely long path with tons of subdirs created by . Eg. which is very painful.

Discussion:
# `go test` does not install the things it builds. `go test -i` installs # the build artifacts but doesn't run the tests.  The two together provide # a large speedup for tests that do not need to be rebuilt. <del> printf "%sn" "${@}" | grep -Ev $cover_ignore_dirs | xargs -I{} -n1 -P${KUBE_COVERPROCS}  bash -c "set -o pipefail; _pkg="{}"; _pkg_out=${_pkg////_};  go test -i ${goflags[@]:+${goflags[@]}}  ${KUBE_RACE}  ${KUBE_TIMEOUT}  -cover -covermode="${KUBE_COVERMODE}"  -coverprofile="${cover_report_dir}/${_pkg}/${cover_profile}"  "${KUBE_GO_PACKAGE}/${_pkg}"  ${testargs[@]:+${testargs[@]}} go test ${goflags[@]:+${goflags[@]}}  ${KUBE_RACE}  ${KUBE_TIMEOUT}  -cover -covermode="${KUBE_COVERMODE}"  -coverprofile="${cover_report_dir}/${_pkg}/${cover_profile}"  "${KUBE_GO_PACKAGE}/${_pkg}"  ${testargs[@]:+${testargs[@]}}  | tee ${junit_filename_prefix:+"${junit_filename_prefix}-$_pkg_out.stdout"}  | grep "${go_test_grep_pattern}""  && test_result=$? || test_result=$? </del> <ins> printf "%sn" "${@}"  | grep -Ev $cover_ignore_dirs  | xargs -I{} -n 1 -P ${KUBE_COVERPROCS}  bash -c "set -o pipefail; _pkg="$0"; _pkg_out=${_pkg////_};  go test -i ${goflags[@]:+${goflags[@]}}  ${KUBE_RACE}  ${KUBE_TIMEOUT}  -cover -covermode="${KUBE_COVERMODE}"  -coverprofile="${cover_report_dir}/${_pkg}/${cover_profile}"  "${KUBE_GO_PACKAGE}/${_pkg}"  ${testargs[@]:+${testargs[@]}} go test ${goflags[@]:+${goflags[@]}}  ${KUBE_RACE}  ${KUBE_TIMEOUT}  -cover -covermode="${KUBE_COVERMODE}"  -coverprofile="${cover_report_dir}/${_pkg}/${cover_profile}"  "${KUBE_GO_PACKAGE}/${_pkg}"  ${testargs[@]:+${testargs[@]}}  | tee ${junit_filename_prefix:+"${junit_filename_prefix}-$_pkg_out.stdout"}  | grep "${go_test_grep_pattern}""  {}  && test_result=$? || test_result=$? </ins> produceJUnitXMLReport "${junit_filename_prefix}"