Skip to content

Commit

Permalink
Add KeepAliveProc to basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
griswaldbrooks committed Sep 9, 2023
1 parent 1deb67c commit 1f97d56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion minimal_integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(BUILD_TESTING)
test/basic_test.cpp
)
ament_target_dependencies(basic_test ${THIS_PACKAGE_INCLUDE_DEPENDS})
add_ros_test(test/launch/basic_test.test.py TIMEOUT 120 ARGS "test_binary_dir:=${CMAKE_CURRENT_BINARY_DIR}")
add_launch_test(test/launch/basic_test.test.py TIMEOUT 120 ARGS "test_binary_dir:=${CMAKE_CURRENT_BINARY_DIR}")
endif()

ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
Expand Down
10 changes: 5 additions & 5 deletions minimal_integration_test/test/launch/basic_test.test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-
import launch
from launch.actions import TimerAction
from launch.substitutions import PathJoinSubstitution
from launch_ros.actions import Node
import launch_testing
import os
import sys
import unittest


Expand All @@ -29,7 +25,11 @@ def generate_test_description():
"containing test executables",
),
basic_test,
# TimerAction(period=2.0, actions=[basic_test]),
# In tests where all of the procs under tests terminate themselves, it's necessary
# to add a dummy process not under test to keep the launch alive. launch_test
# provides a simple launch action that does this:
# https://github.com/ros2/launch/blob/aed025e04e0b143362c69bf29a67b2ffff4c59ee/launch_testing/test/launch_testing/examples/args_launch_test.py#L63
launch_testing.util.KeepAliveProc(),
launch_testing.actions.ReadyToTest(),
]
), {
Expand Down

0 comments on commit 1f97d56

Please sign in to comment.