-1

Closely related to my question is VSCode: how to interrupt a running Python test?, however in my case the standard method of pressing the square in the Test Results tap does not work.

What is different in my tests?

I have code that via multiprocessing (and os.fork) executes multiple sub processes. There are two issues that cause the tests to be stuck.
One, because of the forking (involving JAX) a deadlock happens when several tests are executed in one set, this seems to be a limitation of unittest cleanup.
Secondly, I might have a breakpoint in code that is executed in these other processes. Additionally is a custom debugger in place of the standard pdb that would allow debugging and hooking into these processes when executed normally - but not when using tests. To be precise I am using ray's distributed debugger and the last message I get is that the debugger is now active. This prevents the tests from being stopped in the normal way via the square button.

I tried to kill some running python processes but there is a long list of processes that are running, I don't know which is the correct to select.

Is there another integrated method that allows to immediately terminate a running test that will work in my case? For example shutdown and restart the test console (process).

3
  • maybe run ps aux | grep python > file.txt before running test and compare file with the same command when test is running - you will see what to search next time. If you will have two files then you may try to compare them with command diff or use GUI program like meld Commented Jul 10 at 1:16
  • 1
    Task manager might work. Commented Jul 10 at 3:04
  • When it happens it is by mistake, i.e. I've forgotten to remove a breakpoint statement. As I do not know this beforehand I would need to automate the process grabbing to be done before all tests. hmm. If a normal process is stuck I can just end the shell its running in, is there anything similar for the inbuilt tests? Commented Jul 11 at 13:37

1 Answer 1

0

The only answer I have is to reload the window altogether to stop the testing process, e.g. Ctrl+P; > Reload Window. (command:workbench.action.reloadWindow)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.