tqchen commented on code in PR #19945:
URL: https://github.com/apache/tvm/pull/19945#discussion_r3524059617
##########
tests/scripts/setup-pytest-env.sh:
##########
@@ -76,10 +76,18 @@ function run_pytest() {
suite_name="${test_suite_name}-${current_shard}-${ffi_type}"
- DEFAULT_PARALLELISM=1
+ DEFAULT_PARALLELISM=auto
- if [[ ! "${extra_args[*]}" == *" -n"* ]] && [[ ! "${extra_args[*]}" == *"
-dist"* ]]; then
- extra_args+=("-n=$DEFAULT_PARALLELISM")
+ # Keep the default scoped to run_pytest so nested and one-off pytest
+ # invocations do not recursively start workers. Explicit options from
+ # either the environment or the caller remain authoritative.
+ pytest_args=" ${PYTEST_ADDOPTS:-} ${extra_args[*]} "
+ if [[ "${pytest_args}" != *" -n"* ]] &&
+ [[ "${pytest_args}" != *" --numprocesses"* ]] &&
+ [[ "${pytest_args}" != *" --dist"* ]] &&
+ [[ "${pytest_args}" != *" -d "* ]] &&
+ [[ "${pytest_args}" != *" --tx"* ]]; then
+ extra_args+=("-n=$DEFAULT_PARALLELISM" "--dist=loadgroup")
fi
Review Comment:
The affected launchers run only in environments that already install the
project's declared `pytest-xdist` test dependency, so we are not adding runtime
plugin detection. The wrapper is now removed and `-n auto` is passed directly
by those launchers; one-off and embedded pytest invocations remain unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]