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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running pytest on Charcoal-SE/Smokedetector under scalene fails #863

Open
micsthepick opened this issue Sep 9, 2024 · 5 comments
Open
Assignees

Comments

@micsthepick
Copy link

Describe the bug
Pytest cannot run due to below error(s):

============================================================================================== test session starts ==============================================================================================
platform linux -- Python 3.8.19, pytest-8.3.2, pluggy-1.5.0
rootdir: /home/mike/sources/SmokeDetector
plugins: xdist-3.6.1, timeout-2.3.1, cov-5.0.0
timeout: 300.0s
timeout method: signal
timeout func_only: False
created: 3/3 workersScalene: could not find input file /home/mike/sources/SmokeDetector/-u
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/_pytest/main.py", line 281, in wrap_session
INTERNALERROR>     config.hook.pytest_sessionstart(session=session)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/_pytest/logging.py", line 784, in pytest_sessionstart
INTERNALERROR>     return (yield)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/xdist/dsession.py", line 90, in pytest_sessionstart
INTERNALERROR>     nodes = self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/xdist/workermanage.py", line 88, in setup_nodes
INTERNALERROR>     return [self.setup_node(spec, putevent) for spec in self.specs]
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/xdist/workermanage.py", line 88, in <listcomp>
INTERNALERROR>     return [self.setup_node(spec, putevent) for spec in self.specs]
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/xdist/workermanage.py", line 97, in setup_node
INTERNALERROR>     gw = self.group.makegateway(spec)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/execnet/multi.py", line 154, in makegateway
INTERNALERROR>     gw = gateway_bootstrap.bootstrap(io, spec)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/execnet/gateway_bootstrap.py", line 88, in bootstrap
INTERNALERROR>     bootstrap_import(io, spec)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/execnet/gateway_bootstrap.py", line 36, in bootstrap_import
INTERNALERROR>     s = io.read(1)
INTERNALERROR>   File "/home/mike/.local/lib/python3.8/site-packages/execnet/gateway_base.py", line 536, in read
INTERNALERROR>     raise EOFError("expected %d bytes, got %d" % (numbytes, len(buf)))
INTERNALERROR> EOFError: expected 1 bytes, got 0

To Reproduce
Steps to reproduce the behavior:
(tested in WSL2) - Setup a conda env with scalene, clone github.com:charcoal-se/smokedetector.git, pip install -r requirements.txt, and run the following command (modified from a CI yaml) scalene --profile-all -m pytest -W default::Warning --cov=chatcommunicate --cov=findspam --cov=globalvars --cov=spamhandling --cov=datahandling --cov=chatcommands --cov=helpers -n 3 --dist loadgroup --timeout=300 test

Please include a minimum working example if at all possible.

Expected behavior
Runs like as if I'd replaced scalene --profile-all with just python.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Widows 11 Education
  • Browser Firefox
  • Version:
wsl --version
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.4112

If you have not yet tried with the repository version (python3 -m pip install git+https://github.com/plasma-umass/scalene), please try that before reporting.
(sidenote this may be more helpful at the top of the issue template) - replicates with latest.

Additional context
SmokeDetector can take a while to clone (not too long), so if you think that this might be solvable without cloning it, I'd certainly recommend investigating that way.

@micsthepick
Copy link
Author

possibly related: #82

@micsthepick
Copy link
Author

... and what makes me think so, is the error from scalene:

Scalene: could not find input file /home/mike/sources/SmokeDetector/-u

@emeryberger
Copy link
Member

Can you try putting --- after the Scalene flag(s) and before pytest?

@emeryberger emeryberger self-assigned this Sep 9, 2024
@micsthepick
Copy link
Author

@emeryberger still reproduces with the following: scalene --profile-all --- -m pytest -W default::Warning --cov=chatcommunicate --cov=findspam --cov=globalvars --cov=spamhandling --cov=datahandling --cov=chatcomm ands --cov=helpers -n 3 --dist loadgroup --timeout=300 test

@micsthepick
Copy link
Author

micsthepick commented Sep 9, 2024

just in case I needed to put -m pytest before the ---, the following doesn't work either:

scalene --profile-all -m pytest --- -W default::Warning --cov=chatcommunicate --cov=findspam --cov=globalvars --cov=spamhandling --cov=datahandling --cov=chatcomm
ands --cov=helpers -n 3 --dist loadgroup --timeout=300 test

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

2 participants