Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locust monkey patching leads to test cross-talking #3193

Open
mreso opened this issue Jun 13, 2024 · 0 comments
Open

Locust monkey patching leads to test cross-talking #3193

mreso opened this issue Jun 13, 2024 · 0 comments
Assignees

Comments

@mreso
Copy link
Collaborator

mreso commented Jun 13, 2024

馃悰 Describe the bug

Some fail tests fail if locust is imported in test_benchmark.py

Error logs

>               self.pid = _posixsubprocess.fork_exec(
                        args, executable_list,
                        close_fds, tuple(sorted(map(int, fds_to_keep))),
                        cwd, env_list,
                        p2cread, p2cwrite, c2pread, c2pwrite,
                        errread, errwrite,
                        errpipe_read, errpipe_write,
                        restore_signals, start_new_session,
                        gid, gids, uid, umask,
                        preexec_fn)
E                       AttributeError: 'NoneType' object has no attribute 'fork_exec'

/home/ubuntu/miniconda3/envs/serve/lib/python3.10/subprocess.py:1796: AttributeError
----------------------------------------------------------------------------------------------------- Captured stdout setup -----------------------------------------------------------------------------------------------------
TorchServe is not currently running.
TorchServe is not currently running.
['torchserve', '--start', '--model-store', '/tmp/pytest-of-ubuntu/pytest-20/work_dir0/model_store', '--ts-config', '/tmp/pytest-of-ubuntu/pytest-20/tp_model0/config.properties', '--no-config-snapshots', '--disable-token', '--
model-api-enabled']
======================================================================================================= warnings summary ========================================================================================================
../miniconda3/envs/serve/lib/python3.10/site-packages/locust/__init__.py:15
  /home/ubuntu/miniconda3/envs/serve/lib/python3.10/site-packages/locust/__init__.py:15: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6.
It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util.ssl_ (/home/ubuntu/m
iniconda3/envs/serve/lib/python3.10/site-packages/urllib3/util/ssl_.py)', 'urllib3.util (/home/ubuntu/miniconda3/envs/serve/lib/python3.10/site-packages/urllib3/util/__init__.py)'].
    monkey.patch_all()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================================================================================== short test summary info ====================================================================================================
ERROR test/pytest/test_auto_recover.py::test_tp_inference - AttributeError: 'NoneType' object has no attribute 'fork_exec'
============================================================================================ 1 passed, 1 warning, 1 error in 12.15s =============================================================================================

Installation instructions

dev

Model Packaging

none

config.properties

none

Versions

 0.11

Repro instructions

pytest test/pytest/test_benchmark.py test/pytest/test_auto_recover.py

Possible Solution

gevent/gevent#1016 or not importing locust in test

@mreso mreso self-assigned this Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant