Skip to content

Commit b773ab2

Browse files
sandreimalindima
authored andcommitted
Fix generic_signal_handler test
Firecracker no longer bails out on SIGPIPE, so we just validate a different log message and flush metrics before asserting. Signed-off-by: Andrei Sandu <[email protected]>
1 parent 7ff8983 commit b773ab2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/integration_tests/functional/test_signals.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,19 @@ def test_generic_signal_handler(test_microvm_with_api, signum):
5858
assert len(line_metrics) == 1
5959

6060
os.kill(firecracker_pid, signum)
61-
msg = 'Shutting down VM after intercepting signal {}'.format(signum)
61+
62+
# Firecracker gracefully handles SIGPIPE (doesn't terminate).
63+
# False positive during lint - object member is created dynamically.
64+
# pylint: disable=E1101
65+
if signum == SIGPIPE.value:
66+
msg = 'Received signal 13'
67+
68+
# Flush metrics to file, so we can see the SIGPIPE at bottom assert.
69+
# This will also fail if FC has exited due to SIGPIPE.
70+
response = microvm.actions.put(action_type='FlushMetrics')
71+
assert microvm.api_session.is_status_no_content(response.status_code)
72+
else:
73+
msg = 'Shutting down VM after intercepting signal {}'.format(signum)
6274

6375
microvm.check_log_message(msg)
6476

0 commit comments

Comments
 (0)