Testing SIGUSR1 handling causes build error due to abrupt termination


#1

I have some test cases (Python 3.7 / Linux) that sends SIGUSR1 for testing differentiated signal-based shutdown behavior. The test suite works as expected in my local macOS and Linux machines, but fails on Travis CI due to abrupt termination of the CI worker itself. (Link: https://travis-ci.org/achimnol/aiotools/jobs/456297997)

Is there any way to signal-based tests working as well on Travis CI?


#2

In https://github.com/achimnol/aiotools/blob/173dabfdffee2d063c8d64376c866cf77afe0a02/tests/test_server.py#L159, you’re sending the signal to PID 0 which means every process in the current process group. And unless a process has installed a handler for SIGUSR1, receiving it terminates the process.

So you yourself are terminating the Travis worker.

Send the signal only to a specific PID instead – e.g. to the result of os.getpid() for the current process.


#3

I have changed my test cases to send SIGUSR1 to os.getpid() but the result is still same.
https://travis-ci.org/achimnol/aiotools/builds/457272686


#4

If you are interested, we can enable the debug feature for this repository to troubleshoot further.


#5

If that would help, yes please. :slight_smile:
Maybe… should I “separate” my process group manually for testing with signals?


#6

The debug feature has been enabled for https://github.com/achimnol/aiotools.