Skip to content

Commit

Permalink
Do not check elapsed time when terminating generate_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lahtinep committed Oct 17, 2024
1 parent 6b34e13 commit 0cda855
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions trollflow2/tests/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,26 +891,20 @@ def test_sigterm_generate_messages():
"""Test that sending sigterm to Trollflow2 stops it."""
import os
import signal
import time
from multiprocessing import Process

from trollflow2.launcher import generate_messages

connection_parameters = {"nameserver": False, "addresses": "localhost:40000", "topic": "/test"}
proc = Process(target=generate_messages, args=(connection_parameters, ))
proc.start()
tic = time.time()
# Wait for the message listening loop to start
time.sleep(1)
# Send SIGTERM
os.kill(proc.pid, signal.SIGTERM)
proc.join()

assert proc.exitcode == 0
# The queue.get timeout is set to 5 seconds, so it should be at
# least this long until the process is terminated
elapsed_time = time.time() - tic
assert elapsed_time >= 5.0


def test_sigterm_runner(tmp_path):
Expand Down

0 comments on commit 0cda855

Please sign in to comment.