Skip to content

Commit

Permalink
[CI] Fail in case of process crash ⚠️ (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
3wnbr1 committed Mar 24, 2021
1 parent 269f56c commit 4b68ac1
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
19 changes: 18 additions & 1 deletion src/titan/launch/cloud-interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
from ament_index_python.packages import get_package_share_directory

import launch
from launch.actions import GroupAction, IncludeLaunchDescription
from launch.actions import (
GroupAction,
IncludeLaunchDescription,
RegisterEventHandler,
EmitEvent,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch.events import Shutdown
from launch.event_handlers import OnProcessExit


robots = ["asterix"]

Expand Down Expand Up @@ -48,4 +56,13 @@ def generate_launch_description():
]
)
]
+ [
RegisterEventHandler(
event_handler=OnProcessExit(
on_exit=[
EmitEvent(event=Shutdown()),
]
)
)
]
)
14 changes: 13 additions & 1 deletion src/titan/launch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
from ament_index_python.packages import get_package_share_directory

import launch
from launch.actions import IncludeLaunchDescription
from launch.actions import IncludeLaunchDescription, RegisterEventHandler, EmitEvent
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.events import Shutdown
from launch.event_handlers import OnProcessExit


robots = ["asterix"]

Expand All @@ -31,4 +34,13 @@ def generate_launch_description():
)
for robot in robots
]
+ [
RegisterEventHandler(
event_handler=OnProcessExit(
on_exit=[
EmitEvent(event=Shutdown()),
]
)
)
]
)
18 changes: 17 additions & 1 deletion src/titan/launch/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
from ament_index_python.packages import get_package_share_directory

import launch
from launch.actions import GroupAction, IncludeLaunchDescription
from launch.actions import (
GroupAction,
IncludeLaunchDescription,
RegisterEventHandler,
EmitEvent,
)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch.events import Shutdown
from launch.event_handlers import OnProcessExit
from webots_ros2_core.webots_launcher import WebotsLauncher


Expand Down Expand Up @@ -72,4 +79,13 @@ def generate_launch_description():
]
)
]
+ [
RegisterEventHandler(
event_handler=OnProcessExit(
on_exit=[
EmitEvent(event=Shutdown()),
]
)
)
]
)

0 comments on commit 4b68ac1

Please sign in to comment.