03-30-2020 03:25 AM
Hi,
I'm using TestStand 2016 with the python step module and pthon 3.8.2.
Randomly I get the problem that TestStand starts my python scripts, but does not execute them at all. The even do not close anymore.
I get the same behaviour sometimes, if I try to start the scripts with the cmd step. There in the console I can see that the python interpreter get started, but does not execute anything. After this appeared once, I'm unable to run any new python script with TestStand.
The only way to resolve it, is to retsart the PC, which even leads to a bluescreen during reboot.
When I test my scripts within the IDE, with which I wrote them, they work proberly.
There is also no error, if a start them manually with the windows cmd.
Has anybody encountered this problem or has an idea how to solve it?
Max
03-31-2020 02:59 AM
Edit:
I checkedtoday what is happening in the background and I saw, there are several instances of the niPythonHost.exe spwaned. One for each of my threads.
But with the taskmanager I can only kill one of the tasks, which frees my complete test execution again.
If I then try to close the remaining niPythonHost.exe after the test has finished it states:
Access denied.
Unload all modules or closing TestStand also do not close niPythonHost.exe .
03-31-2020 11:37 PM
max_str,
You mentioned that issue occurs irrespective of using Python custom step types or when you use command step to invoke the python interpreter and run the script. Also, it does not occur when you execute it using IDE.
Running it through command step (where issue exists) is similar to directly executing the python script using python.exe. This makes me think that, issue might be in the script and might be related to current working directory or similar things.
The following are the things I recommend to debug more:
-Shashidhar
04-01-2020 04:08 AM
I have changed to Global, but now I have the Problem, that my scripts do not start in parallel anymore (spawned by TestStand threads in parallel).
I'm quit new to the TestStand python environment. Is it possible to run several scripts in parallel with the global setting? I even need to run the same script twice.....
I checked my code but could not find any possible deadlock. I attached the script, which I need to run twice in the background.
It just builds an ethernetframe and sends it in loop with scapy untill a close file is found.
04-02-2020 02:32 AM
Ok I think I found what the caused the error but not why....
I needed to set a wait time from currently 1s between the start of each of my parallel python calls. This seems to be stable now.
Same behaviour if i would start the script fast parallel with cmd.