Skip to content

Commit 84da19d

Browse files
committed
test(integration): widen gateway shutdown timeouts for sanitizer overhead
The gateway shutdown sequence (mdns stop, REST server stop, transport teardown, plugin manager shutdown, member destructors) completes well under a second normally, but under TSan/ASan overhead on CI runners it can exceed the launch_ros defaults (5s sigterm_timeout / 5s sigkill_timeout). When that happens launch_testing escalates SIGINT -> SIGTERM -> SIGKILL and the TestShutdown.test_exit_codes assertion reports exit code -9 even though the gateway is mid-shutdown. The TSan run for PR #398 hit exactly this on test_scenario_thermal_protection: the gateway logged TriggerTopicSubscriber shutdown complete and other steps but was still cleaning up when the SIGKILL timer fired. Set sigterm_timeout=30 and sigkill_timeout=15 in create_gateway_node so every integration test that goes through this factory gets the longer windows. The bigger numbers do not slow down healthy runs since the process exits as soon as shutdown actually finishes.
1 parent 5249ea6 commit 84da19d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/ros2_medkit_integration_tests/ros2_medkit_test_utils/launch_helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ def create_gateway_node(*, port=DEFAULT_PORT, extra_params=None, coverage=True):
106106
output='screen',
107107
parameters=[params],
108108
additional_env=get_coverage_env() if coverage else {},
109+
# Default SIGINT->SIGTERM escalation is 5s and SIGTERM->SIGKILL is 5s.
110+
# Under TSan/ASan the gateway shutdown sequence (mdns stop, REST server
111+
# stop, transport teardown, plugin shutdown) easily exceeds 5s on slower
112+
# CI runners, causing launch_testing to escalate to SIGKILL and the
113+
# TestShutdown.test_exit_codes check to report -9. The process still
114+
# shuts down cleanly given enough time, so widen both windows.
115+
sigterm_timeout='30',
116+
sigkill_timeout='15',
109117
)
110118

111119

0 commit comments

Comments
 (0)