-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Tests do not start when working Remote #23249
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
Comments
Hi! What I am noticing from your logs that there is no reference to If you are able to try this on the pre-release of the python extension that would be helpful as well because we just switched test communication to use named pipes which may also help if there is a communication issue. |
@eleanorjboyd Hi! I don't see any lines I also tried to switch to pre-release version of the extension ( It looks like frontend basically does nothing when I click "Run test" or invoke tests in any way (e.g. Shift+Command+P → "Test: Run All Tests" do not work either) except of switching to "Test results" pane and displaying there "Finished running tests!". ![]()
|
Thanks for that info, I have not seen this problem before so I am sorry I don't have a direct debugging solution.
Thank you! |
This is not exactly what I expect, as my pytest tests live in the directory
Works without problems:
No, I don't see errors like this after second discovery. Below is the log (I cleared the log, then refreshed tests, waited for them to populate, and refreshed again; the full logs after the clearing is present).
I do not see anything related to cwd in my settings.json. To be sure, I deleted User Settings. My workspace settings are included above, and my Remote settings are just
Thanks for your help! |
Can you see if it makes a difference if you remove all the pytest args and instead just leave it in your settings as Thanks! Sorry for all the back and forth. |
I believe I localized the problem! The tests stop working if I open a folder through a symlink. I reproduced it on three Linux remote systems. Example setup:
If I connect to that remote system with either SSH or Tunnel, then open I am currently not sure whether it is related to Remote systems or not at all, as I cannot open a folder through a symlink on my local MacOS machine (the OS simply substitutes a symlinked path with the corresponding real path in the Open Folder dialog). I tried, however, to use my local machine as remote and access it through Tunnel — then I can open folder through a symlink and I get the same result (tests are not working). The problem reproduces with empty "python.testing.pytestArgs". It also reproduces with UnitTest. The behaviour of pre-release version of Python extension ( |
Okay, I see that it looks like a duplicate for #23223 after all. |
Thank you for your careful investigation! I am putting in a PR to fix the symlink issue described in #232223 now so it should be ready tomorrow so that you can try it on insiders. Getting the repo without the path getting resolved was also very challenging for me- ended up having to launch vscode from my terminal on my mac using Thanks! |
Hello! I have put in a fix for this issue and it should now be working! If you could try it on the newest version of the python extension nightly pre-release that would be great so we know if it works! Happy coding! |
@eleanorjboyd I am using v2024.5.11101014 (pre-release) version of the Python extension under VS Code Insiders, but the problem still reproduces. I thought that probably extension is not updated yet (I think that it was out before you merged the fix)? |
Are you on insiders or stable vscode? We had some updates which require the vscode version to be "^1.89.0-20240415" |
Hi! Sorry we seem to have had problems publishing the pre-release so this change is not out. I didn't realize this earlier. I will let you know when it is for sure, I did test it myself and saw pre-release not working but a specific dev version I have working so hopefully when we get it onto a pre-release version it will work for you. Thanks |
@eleanorjboyd I still can reproduce the problem on Python extension |
Hi @ischurov! Sorry this still isn't working. It should now be out on vscode stable, could you check your versions on both the local and remote machine to check to make sure you have them all updated? If it still doesn't work I will re-open and try and repro again. Thanks! |
Hi @eleanorjboyd! I updated VSCode (stable) and can reproduce the issue with SSH-Remote. To make sure that the remote version is also updated, I deleted
I can reproduce the problem on the release version of Python extension ( Thanks! |
Thank you for checking!! I will reopen now. I did add additional logs I am now remembering with my most recent changes- could you resend your python logs with the log level set to trace. Sorry to ask you to run it again! |
Sure, here is it. It's a different system, so details can differ from what I was sending before; if needed, I can reproduce it on the previous system as well.
|
Hi! Does it work if you run it with pytest / is it possible to use pytest for your solution? We only fixed this for pytest and I think I got confused in your initial request as we discussed both pytest and unittest as causing problems but your specific run you just sent was with unittest. To fix for unittest will take some extra work- I have no looking into the symlink issue there and my strategy I used for pytest is not translatable due to its usage of pytest args to support the symlink bug fix. Thanks! |
Yes, I can confirm that pytest is working! If I can help with the unittest issue in any way, I would be glad to do so. |
Great thanks! Do you need unittest or can you run all your unittests with pytest? Curious if I need to implement a solution since pytest can normally handle unittest scenarios and that could avoid the item. I can also add it with a lower priority or give you advice on how to fix it if you want to give it a go yourself! |
Oh, I didn't know that pytest supports unittest tests, thanks! I was able to run unittest tests via pytest on a "minimal repro" system, but failed to do so with my real codebase on a computation cluster I use. Moreover, even test discovery doesn't work (it worked before). The good news is that I see some seemingly relevant messages in the logs, see below.
|
hm seeing Other questions if it works without failure from the terminal:
|
I tried to run
|
Sorry the vscode_pytest is a custom plugin we add- you can just remove that from your args and see if it works then, as well as the -p in front of it, to try it from the terminal and test if you see the same permissions error. If not then it is an access we are attempting to do with the plugin to return data. You also say you have a cluster you are running it on- any reason this might block named pipes from getting created? |
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! |
Uh oh!
There was an error while loading. Please reload this page.
Type: Bug
Behaviour
I cannot run any test in my project when I use Remote Tunnel or Remote SSH. This applies both to UnitTest and pytest frameworks. Test discovery works, but after that when I run any test, it immediately finishes. In Test Results pane, I see only message "Finished running tests!". No tests are marked as passed or failed. If I add time.sleep(10) in my test, it finishes immediately nevertheless. When I run tests locally, they work as expected, so it seem to be related to remote execution.
This is a reopening of #21992 with the diagnostic data requested (I cannot reopen it in the usual way as it is locked).
I can reproduce this problem on two different clusters, using two different Python environments (Python and nix). It also reproduces at vscode.dev.
Below I include the data from the Python pane. Log level is set to trace. When I run the test, the only thing is being added to this log is
[debug] Found cached env for /vol/tcm10/ischurov/.conda/envs/latsym2/bin/python
.Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.4.1
VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:42:52.765Z)
OS version: Darwin x64 22.1.0
Modes:
Remote OS version: Linux x64 4.18.0-372.80.1.el8_6.x86_64
Remote OS version: Linux x64 5.19.0-46-generic
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: