-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Pytest discovery fails on RHEL8 due to symlink #21373
Comments
@mrburrito To get detailed logs, use |
@karthiknadig giving that a shot now. Is that not controlled by the |
Trace logs from a manual test refresh:
|
This is the output from the test discovery command if I run it from
|
when you run pytest from the integrated terminal does it work? We are specifically running the command: |
That command does not appear to work, on either RHEL8 or CentOS7.
However, if I remove the
|
Is the The JSON block above is the output from running that |
What do you have in your pytest args in your workspace settings? Might look something like this: |
pytest args are empty ( |
All Python-related settings defined in the workspace. No related settings in user or remote configuration. {
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.formatting.provider": "black",
"python.linting.flake8Args": [
"--ignore=E501,W503",
"--extend-exclude=.venv,.pytest_cache"
],
"python.linting.flake8Enabled": true,
"python.testing.pytestArgs": [],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.terminal.activateEnvironment": false,
"python.testing.cwd": "",
} |
Updated to the latest release (VSCode 1.79.1, Python 2023.10.1) and still having the same problem, with and without the |
Anything jump out as a configuration issue? Are you able to reproduce with a RHEL8 machine? |
Problem still exists after 1.79.2 update:
|
Just updated to 1.80.0. Still a problem. Any ideas/updates on what could be causing this and how to fix it? It's about to be a major problem for me as we're switched over to RHEL8 instances.
|
Hello! Sorry for the delay! Could you try adding this setting to your settings and see if this helps? We have just released a rewrite that helps with buggy behavior in testing and might solve your issue. Thanks! setting: |
That got a little further! I've had that enabled in settings.json for a good bit so not sure why it's different this time. I do see the "Experiment 'pythonTestAdapter' is active" and "Test server listening." log messages now, so maybe it didn't get picked up earlier today. Either way... still some issues. Now I see the tests in Test Explorer but I can't run them. Clicking on the refresh, run, and debug buttons from either the test explorer or the gutter in my test files doesn't do a thing. I also tried running from command line to generate pytest's results files and Test Explorer isn't seeing those to update the status in the view. It typically does when I do the same on our old CentOS7 workstations. Last strange thing, when I open my user settings.json on the Windows host, the |
@karthiknadig what is the expected behavior for the setting while using remote-ssh? Is anything special necessary? |
When you click run do you see anything come up in the logs? Can you check the output for the python test logs and see if anything is printed there (since those are separate from the regular python logs they sometimes print errors here that aren't shown elsewhere). |
There should not be anything specifically needed for this scenario. Getting logs on run or debug would be the next step. One possibility is that python is crashing the moment we hit run or debug. This can occur in cases where we for some reason run with non-activated environment, and some required binary is not available on path. But this is rare. |
Python log (level set to Trace):
Also, constantly streaming this message:
Nothing in the Python Test Logs. Confirmed I am pointing at my virtual environment ( Also, if I reload the window and then open the Test Explorer it shows the tests. When I click the run button, the status message shows up under the filter box saying |
Here's the test output from the test discovery. That's the only thing that shows up there. Confirmed it's coming from discovery by clearing logs and then clicking the run button.
The
|
Realized today I wasn't using the Insiders Build but still had the test server enabled. Not sure if there's a difference at this point? Either way - installed the latest Insider's Build and tested again. I still see the same problem, though clicking "Refresh" pops up an error toaster that says
I also found a separate thread that mentioned symlinks are a problem. I reopened my workspace on RHEL8 from the absolute path and my simple project found all the tests and was able to run them! Hoping you can figure out why symlinks break everything and get that fixed. |
My primary multi-root workspace is still having issues, but it may be the new issue I submitted, rather than this one. #21599 |
Hi! Yes we are working on symlinks- I realized that might still be an ongoing issue- sorry about that! I am glad you got it working and sorry about the multi-root system. Will look into that as well. Thanks! |
Disabled the |
Consolidating all issues on testing and symlinks to issue #9347. Let me know if you do not think this other issue is representative of the bug you are facing. Thanks! |
#9347 appears to be similar. It looked like that was more about starting python from a symlink though it seems that the conversation steered towards opening projects with path substitution at the end (e.g. from |
I have the same problem working with VScode on AzureML. I have my python project in azure ml file share. I connect to the Azure ML compute with vscode by navigating to open with VSCode option in Azure ML. The tests are not discovered and there are no error logs. After struggling with this problem i came across this issue here. Please let me know my problem is related to the issue here. |
yes this is likely related @adrshm91, will update this issue with progress and I work towards a fix and then you can try it once again. Thanks |
Spent over an hour trying and giving up solving the tests being discovered but not being run no matter what i did, no logs anywhere giving any hints, until because of mrburrito i tried just opening |
Hi! Looking to fix this but having trouble getting a minimal repro that produces the error. I have tried to replicate it via symlinks on a single disk (but it works) so I think it might only occur when you have symlinks across two different disks. Is that how everyone's setup is? |
Was attempting this repro, copied message from #21576 ''' Hi @jonodhawkins thank you for the info! Looks like an issue with symlinks, which is something we know is broken. I am currently trying to fix it but having trouble repro-ing the behavior. To clarify your steps @jonodhawkins, create "Test Project Structure" as described at a local path /mnt/storage/[project_name] |
Hi @eleanorjboyd, Following the steps above using vscode version:
I also cannot reproduce the behaviour. However, if instead of using
to open the directory, I use the |
great thank you! I tried it as described but with symlinks on the same disk and it didn't work so I think the paths being on separate disks is necessary. Currently figuring out how to configure a similar setup for myself to test on. Thanks! |
Hello! I got a setup working on a parallels VM. I have a windows VM with parallels then have WSL on that machine to a Ubuntu machine. These are the steps I took and am still not able to repro. Any steps I am missing / did incorrectly?
|
Hi @eleanorjboyd - if in the same setup, replacing step 9 with the below, can you reproduce? Opening the folder from the UI vs. directly instantiating an instance of
|
I tried it via the open folder command (from the vscode UI) and that resulted in the same successful behavior. To specify you open the alias folder as the root and see the issue correct? I think I have tried opening both the parent folder of |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off. Happy Coding! |
Type: Bug
Behaviour
Expected vs. Actual
My company controlled workstation is being upgraded from CentOS7 to RHEL8 and I've been beta testing the RHEL8 workstation this week. I'm using the Remote SSH plugin to open Python projects on the Linux workstation from a Windows 10 desktop.
On CentOS7, VSCode has no problems discovering and running my test suites in pytest. On RHEL8, it shows all the containing modules but no tests in the tree beneath them. I've tried with both the release channel and insiders versions of VSCode (with All expriments enabled and the test server started for insiders) and get the same result.
Steps to reproduce:
python.analysis.logLevel = TRACE
.Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panelUser Settings
Extension version: 2023.8.0
VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:39:26.248Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: Yes
Remote OS version: Linux x64 4.18.0-425.19.2.el8_7.x86_64
Remote OS version: Linux x64 3.10.0-1160.88.1.el7.x86_64
Remote OS version: Linux x64 4.18.0-425.19.2.el8_7.x86_64
Remote OS version: Linux x64 4.18.0-425.19.2.el8_7.x86_64
A/B Experiments
The text was updated successfully, but these errors were encountered: