Skip to content

Commit b974848

Browse files
Ensure shutdown of gz jetty (#682)
1 parent c34b3e9 commit b974848

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

gz_ros2_control_tests/tests/effort_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ def setUpClass(cls):
6565
def tearDownClass(cls):
6666
for proc in psutil.process_iter():
6767
# check whether the process name matches
68-
if proc.name() == 'ruby':
68+
if proc.name() == 'ruby' or 'gz sim' in proc.name():
69+
# up to version 9 of gz-sim
6970
proc.kill()
70-
if 'gz sim' in proc.name():
71+
if 'gz-sim' in proc.name():
72+
# from version 10 of gz-sim
7173
proc.kill()
7274
rclpy.shutdown()
7375

gz_ros2_control_tests/tests/ft_sensor_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ def setUpClass(cls):
6565
def tearDownClass(cls):
6666
for proc in psutil.process_iter():
6767
# check whether the process name matches
68-
if proc.name() == 'ruby':
68+
if proc.name() == 'ruby' or 'gz sim' in proc.name():
69+
# up to version 9 of gz-sim
6970
proc.kill()
70-
if 'gz sim' in proc.name():
71+
if 'gz-sim' in proc.name():
72+
# from version 10 of gz-sim
7173
proc.kill()
7274
rclpy.shutdown()
7375

gz_ros2_control_tests/tests/position_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ def setUpClass(cls):
6565
def tearDownClass(cls):
6666
for proc in psutil.process_iter():
6767
# check whether the process name matches
68-
if proc.name() == 'ruby':
68+
if proc.name() == 'ruby' or 'gz sim' in proc.name():
69+
# up to version 9 of gz-sim
6970
proc.kill()
70-
if 'gz sim' in proc.name():
71+
if 'gz-sim' in proc.name():
72+
# from version 10 of gz-sim
7173
proc.kill()
7274
rclpy.shutdown()
7375

gz_ros2_control_tests/tests/velocity_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ def setUpClass(cls):
6565
def tearDownClass(cls):
6666
for proc in psutil.process_iter():
6767
# check whether the process name matches
68-
if proc.name() == 'ruby':
68+
if proc.name() == 'ruby' or 'gz sim' in proc.name():
69+
# up to version 9 of gz-sim
6970
proc.kill()
70-
if 'gz sim' in proc.name():
71+
if 'gz-sim' in proc.name():
72+
# from version 10 of gz-sim
7173
proc.kill()
7274
rclpy.shutdown()
7375

0 commit comments

Comments
 (0)