Skip to content

Propagate pytest filterwarnings to subprocesses via PYTHONWARNINGS #1638

Open
parthsanan wants to merge 3 commits into
rapidsai:mainfrom
parthsanan:fix-subprocess-deprecation-warnings
Open

Propagate pytest filterwarnings to subprocesses via PYTHONWARNINGS #1638
parthsanan wants to merge 3 commits into
rapidsai:mainfrom
parthsanan:fix-subprocess-deprecation-warnings

Conversation

@parthsanan
Copy link
Copy Markdown
Contributor

Closes #1634

@parthsanan parthsanan requested a review from a team as a code owner March 13, 2026 17:16
Copilot AI review requested due to automatic review settings March 13, 2026 17:16
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Mar 13, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the test configuration to ensure pytest’s filterwarnings settings are propagated to Python subprocesses by exporting them via PYTHONWARNINGS, addressing warnings not being elevated to errors in subprocess-based tests (closes #1634).

Changes:

  • Read filterwarnings from pytest config during pytest_configure.
  • Set PYTHONWARNINGS (if not already set) to a comma-separated list of the configured warning filters so subprocesses inherit the same behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@parthsanan
Copy link
Copy Markdown
Contributor Author

Hey @TomAugspurger, this is ready for review when you get a chance :)

@wence-
Copy link
Copy Markdown
Contributor

wence- commented Apr 29, 2026

/ok to test 58bba88

@wence- wence- added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 29, 2026
Copy link
Copy Markdown
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense, thanks.

@TomAugspurger
Copy link
Copy Markdown
Contributor

/ok to test ca29091

@TomAugspurger
Copy link
Copy Markdown
Contributor

/ok to test 7d15605

@TomAugspurger
Copy link
Copy Markdown
Contributor

Thanks @parthsanan, and sorry for the delay. It looks like there's some CI failures: https://github.com/rapidsai/dask-cuda/actions/runs/25125997838/job/73639887965?pr=1638#step:12:5705

Details
FAILED tests/test_dask_cuda_worker.py::test_unknown_argument - assert b'Scheduler address: --my-argument' in b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n"
 +  where b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n" = CompletedProcess(args=['dask', 'cuda', 'worker', '--my-argument'], returncode=2, stdout=b'', stderr=b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n").stderr
FAILED tests/test_dask_cuda_worker.py::test_pre_import_not_found - assert b"ModuleNotFoundError: No module named 'my_module'" in b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n"
 +  where b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n" = CompletedProcess(args=['dask', 'cuda', 'worker', '127.0.0.1:9369', '--pre-import', 'my_module'], returncode=2, stdout=b'', stderr=b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n").stderr
FAILED tests/test_dask_cuda_worker.py::test_cuda_visible_devices_uuid - AssertionError: assert False
 +  where False = wait_workers(<Client: 'tcp://172.18.0.2:9359' processes=0 threads=0, memory=0 B>, n_gpus=1)
FAILED tests/test_dask_cuda_worker.py::test_rmm_track_allocations - AssertionError: assert False
 +  where False = wait_workers(<Client: 'tcp://172.18.0.2:9369' processes=0 threads=0, memory=0 B>, n_gpus=1)
 +    where 1 = get_n_gpus()
FAILED tests/test_dask_cuda_worker.py::test_get_cluster_configuration - AssertionError: assert False
 +  where False = wait_workers(<Client: 'tcp://172.18.0.2:9369' processes=0 threads=0, memory=0 B>, n_gpus=1)
 +    where 1 = get_n_gpus()
FAILED tests/test_dask_cuda_worker.py::test_worker_fraction_limits - AssertionError: assert False
 +  where False = wait_workers(<Client: 'tcp://172.18.0.2:9369' processes=0 threads=0, memory=0 B>, n_gpus=1)
 +    where 1 = get_n_gpus()
FAILED tests/test_dask_cuda_worker.py::test_worker_timeout - assert 'closing nanny at' in "/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: userwarning: while registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nusage: dask [options] command [args]...\ntry 'dask -h' for help.\n\nerror: no such command 'cuda'.\n"
 +  where "/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: userwarning: while registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nusage: dask [options] command [args]...\ntry 'dask -h' for help.\n\nerror: no such command 'cuda'.\n" = <built-in method lower of str object at 0x78763af62fa0>()
 +    where <built-in method lower of str object at 0x78763af62fa0> = "/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n".lower
 +      where "/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n" = CompletedProcess(args=['dask', 'cuda', 'worker', '192.168.1.100:7777', '--death-timeout', '1'], returncode=2, stdout='', stderr="/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n").stderr
FAILED tests/test_dask_cuda_worker.py::test_worker_cudf_spill_warning[True] - assert b'UserWarning: cuDF spilling is enabled' in b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n"
 +  where b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n" = CompletedProcess(args=['dask', 'cuda', 'worker', '127.0.0.1:9369', '--enable-cudf-spill', '--death-timeout', '1'], returncode=2, stdout=b'', stderr=b"/opt/conda/envs/test/lib/python3.11/site-packages/dask/__main__.py:7: UserWarning: While registering the command with name 'cuda', an exception occurred; the distributed.cli.utils module is deprecated.\n  run_cli()\nUsage: dask [OPTIONS] COMMAND [ARGS]...\nTry 'dask -h' for help.\n\nError: No such command 'cuda'.\n").stderr
FAILED tests/test_dask_setup.py::test_dask_cuda_worker_cli_integration[tcp] - AssertionError: assert False
 +  where False = wait_workers(<Client: 'tcp://172.18.0.2:57847' processes=0 threads=0, memory=0 B>, n_gpus=1)
FAILED tests/test_dask_setup.py::test_dask_cuda_worker_cli_integration[ucx] - AssertionError: assert False
 +  where False = wait_workers(<Client: 'ucx://172.18.0.2:34951' processes=0 threads=0, memory=0 B>, n_gpus=1)
FAILED tests/test_dask_setup.py::test_dask_cuda_worker_cli_integration[ucxx] - AssertionError: assert False
 +  where False = wait_workers(<Client: 'ucxx://172.18.0.2:33345' processes=0 threads=0, memory=0 B>, n_gpus=1)
= 21 failed, 1029 passed, 12 skipped, 3 xfailed, 16 warnings in 541.18s (0:09:01) =

At a glance, they look related to the changes in this PR. Are you interested in investigating those issues?

@parthsanan parthsanan closed this Apr 29, 2026
@parthsanan parthsanan reopened this Apr 29, 2026
@parthsanan
Copy link
Copy Markdown
Contributor Author

Hey @TomAugspurger, thanks for taking a look and I'll absolutely push a fix for the pipeline. Will ping once done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled deprecation warnings in the tests

4 participants