Do not use kill(0, ...)
kill(3) says (https://linux.die.net/man/3/kill): > If pid is 0, sig shall be sent to all processes (excluding an > unspecified set of system processes) whose process group ID is equal to > the process group ID of the sender, and for which the process has > permission to send a signal. When testing, hived is spawned by pytest. This means they're likely to share the same process group id. This means that when hived executes kill(0, SIGINT), the interrupt is also send to pytest, which kills the runner. To fix this, send signal only to ourselves, by using kill(getpid(), ...)
Loading
Please sign in to comment