Open JanDubcak opened 1 year ago
Hi @JanDubcak will update you soon..
Move the code that uses the signal module to the main thread. If possible, refactor your code so that the signal handling is performed within the main thread of the Azure Function. This may involve restructuring your code or using different libraries that do not rely on signals. Use a different approach for triggering the robot framework tests from within the Azure Function. Instead of using pabot with HTTP triggers, you can explore alternative methods such as invoking the tests directly without relying on pabot. This could involve calling the Robot Framework API directly or using other methods for test execution. Check for any available updates or patches for the libraries you are using that may address this issue. Updating to the latest versions of the libraries may include bug fixes or improvements related to thread handling and signal usage.
FWIW, this problem is now also showing up for things completely unrelated to Azure functions, using Azure devops Ci/CD pipelines that merely run a general purpose test suite.
I cannot fathom how and why I can refactor an application core code to satisfy a test runner issues.
...
E Traceback (most recent call last):
E File "/home/vsts/work/1/s/src/scancode/interrupt.py", line 89, in interruptible
E create_signal(SIGALRM, handler)
E File "/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/signal.py", line 56, in signal
E handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
E ValueError: signal only works in main thread of the main interpreter
@vijaykumar911 where can I file this problem?
Well I just bailed on using Azure Portal for tests and switched to local hardware. I wanted to use azure so that I do not have to maintain hardware, but if maintaining hardware and communication with other teams is more simple, than forking open source project to accommodate (imho) flaw in signal handling of deployed containerized function, then I will do so.
Issue description:
When I try to trigger robot frameork tests with pabot using http_trigger i get following error (happy pass and steps to reproduce is a bit lower): Is there an issue with signal handling inside of threads and azure functions? Many thanks for any response.
Happy pass
However if I try to run it directly from python inside container with docker exec. It runs flawalessly.
Env:
Docker container 4-python3.10** requirements.txt**
__init__.py in function rfBrowser:
Content of test rfBrowser/test.robot: