Skip to content

Commit

Permalink
use jazzy test; remove some stray spam; increase some loop timings in…
Browse files Browse the repository at this point in the history
… tests due to intermittant test failure
  • Loading branch information
David Conner committed Aug 27, 2024
1 parent 0a8d48b commit f176c03
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 17 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/flexbe_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ jobs:
test:
strategy:
matrix:
ros: [rolling]
ros: [jazzy] #, rolling]
include:
# - os: ubuntu-24.04
# ros: rolling
# python: python3
# ci_branch: ros2-devel
- os: ubuntu-24.04
ros: rolling
ros: jazzy
python: python3
ci_branch: ros2-devel

Expand Down
6 changes: 3 additions & 3 deletions flexbe_core/flexbe_core/core/operatable_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _operatable_execute(self, *args, **kwargs):

# autonomy level is high enough, report the executed transition
elif outcome is not None and outcome in self.outcomes:
Logger.localinfo(f"controlled State '{self.name}' from '{self.path}'permitting outcome '{outcome}' {self.__class__.__name__}")
# Logger.localinfo(f"controlled State '{self.name}' from '{self.path}'permitting outcome '{outcome}' {self.__class__.__name__}")
self._force_transition = False

return outcome
Expand All @@ -101,8 +101,8 @@ def _publish_outcome(self, outcome):
return

outcome_index = self.outcomes.index(outcome)
Logger.localinfo('Publish outcome: State result: %s > %s (%d) (%d) (%s)'
% (self.name, outcome, outcome_index, self.state_id, self.__class__.__name__))
# Logger.localinfo('Publish outcome: State result: %s > %s (%d) (%d) (%s)'
# % (self.name, outcome, outcome_index, self.state_id, self.__class__.__name__))
# 0 outcome status denotes no outcome, not index so add +1 for valid outcome (subtract in mirror)
self._pub.publish(Topics._OUTCOME_TOPIC, UInt32(data=StateMap.hash(self, outcome_index)))
self._pub.publish(Topics._DEBUG_TOPIC, String(data='%s > %s' % (self.path, outcome)))
Expand Down
4 changes: 2 additions & 2 deletions flexbe_core/test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class TestCore(unittest.TestCase):

test = 0

__TIME_SLEEP = 0.025 # Sleep time for loops
__EXECUTE_TIMEOUT_SEC = 0.025 # Timeout in executor loops for spin once
__EXECUTE_TIMEOUT_SEC = 0.2 # 0.025 # Timeout in executor loops for spin once
__TIME_SLEEP = 0.2 # 0.025 # Sleep time for loops
__LOOP_COUNT = 50 # Number of times to execute loops for checking (total time ~ LOOP_COUNT*(TIME_SLEEP + TIMEOUT))

def __init__(self, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions flexbe_core/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class TestExceptions(unittest.TestCase):
"""Test FlexBE Exception handling."""

test = 0
__EXECUTE_TIMEOUT_SEC=0.025
__TIME_SLEEP = 0.05 # Sleep time for loops
__EXECUTE_TIMEOUT_SEC = 0.2 # 0.025 # Timeout in executor loops for spin once
__TIME_SLEEP = 0.2 # 0.025 # Sleep time for loops

def __init__(self, *args, **kwargs):
"""Initialize TestExceptions instance."""
Expand Down
4 changes: 2 additions & 2 deletions flexbe_core/test/test_exceptions_spin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class TestExceptionsSpin(unittest.TestCase):
"""Test FlexBE Exception handling."""

test = 0
__EXECUTE_TIMEOUT_SEC=0.025
__TIME_SLEEP = 0.05 # Sleep time for loops
__EXECUTE_TIMEOUT_SEC = 0.2 # 0.025 # Timeout in executor loops for spin once
__TIME_SLEEP = 0.2 # 0.025 # Sleep time for loops

def __init__(self, *args, **kwargs):
"""Initialize TestExceptionsSpin instance."""
Expand Down
4 changes: 2 additions & 2 deletions flexbe_core/test/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class TestLogger(unittest.TestCase):
"""Test FlexBE Logger handling."""

test = 0
__EXECUTE_TIMEOUT_SEC=0.025
__TIME_SLEEP = 0.05 # Sleep time for loops
__EXECUTE_TIMEOUT_SEC = 0.2 # 0.025 # Timeout in executor loops for spin once
__TIME_SLEEP = 0.2 # 0.025 # Sleep time for loops

def __init__(self, *args, **kwargs):
"""Initialize TestLogger instance."""
Expand Down
4 changes: 2 additions & 2 deletions flexbe_core/test/test_proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class TestProxies(unittest.TestCase):
"""Test the FlexBE proxies."""

test = 0
__EXECUTE_TIMEOUT_SEC=0.025
__TIME_SLEEP = 0.05 # Sleep time for loops
__EXECUTE_TIMEOUT_SEC = 0.2 # 0.025 # Timeout in executor loops for spin once
__TIME_SLEEP = 0.2 # 0.025 # Sleep time for loops

def __init__(self, *args, **kwargs):
"""Initialize TestProxies instance."""
Expand Down
6 changes: 4 additions & 2 deletions flexbe_onboard/tests/test_onboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_onboard_behaviors(self):
self.clear_extra_heartbeat_ready_messages()

# send the same behavior with different parameters
self.node.get_logger().info('Republish modified behavior ...')
self.node.get_logger().info('\n\nRepublish modified behavior ...')
request.arg_keys = ['param', 'invalid']
request.arg_values = ['value_1', 'should be ignored']
request.input_keys = []
Expand All @@ -224,7 +224,8 @@ def test_onboard_behaviors(self):
behavior_logs = []

# Wait for published message
end_time = time.time() + 1
self.node.get_logger().info('\n\nExecute modified behavior ...')
end_time = time.time() + 2
try:
while time.time() < end_time:
self.executor.spin_once(timeout_sec=0.1)
Expand All @@ -237,6 +238,7 @@ def test_onboard_behaviors(self):
self.executor.spin_once(timeout_sec=0.1)
except Exception as exc:
print(f'\x1b[91mException in executor: {exc}\x1b[0m')
self.node.get_logger().info(f'{behavior_logs}')
self.assertIn('value_1', behavior_logs)
self.node.get_logger().info('Done onboard testing!')
self.executor.spin_once(timeout_sec=0.1)
Expand Down

0 comments on commit f176c03

Please sign in to comment.