Skip to content

Commit

Permalink
tests/conftest: stop coordinator/exporter via SIGINT
Browse files Browse the repository at this point in the history
Since labgrid switched to gRPC, SIGTERM prevents coverage from writing
its data, use SIGINT instead.

Signed-off-by: Bastian Krause <[email protected]>
  • Loading branch information
Bastian-Krause committed Oct 14, 2024
1 parent b6c9e4e commit f93b6de
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from signal import SIGTERM
from signal import SIGINT
import sys
import threading

Expand Down Expand Up @@ -57,9 +57,11 @@ def __init__(self, cwd):
def stop(self):
logging.info("stopping {self.__class__.__name__} pid=%s", self.spawn.pid)

# let coverage write its data:
# Let coverage write its data:
# https://coverage.readthedocs.io/en/latest/subprocess.html#process-termination
self.spawn.kill(SIGTERM)
# Since labgrid switched to gRPC, SIGTERM prevents coverage from writing its data, use
# SIGINT instead.
self.spawn.kill(SIGINT)
if not self.spawn.closed:
self.spawn.expect(pexpect.EOF)
self.spawn.wait()
Expand Down

0 comments on commit f93b6de

Please sign in to comment.