Skip to content

Commit

Permalink
Extend workflow time and fix debian serial port bug (ros-drivers#145)
Browse files Browse the repository at this point in the history
Fix the Github workflow CI build:
- Extend the timeout from 10 minutes to 30 minutes because the worker was observed idling 9 minutes of the 10 minute threshold in https://github.com/ros-drivers/nmea_navsat_driver/runs/5672759022?check_suite_focus=true.
- Change how the virtual serial port script waits for the ports, because the ROS buildfarm debian builder seems to have an inconsistent behavior concerning the time it takes to open virtual serial ports, causing the build to crash sometimes.
  • Loading branch information
ggaessler authored Mar 27, 2022
1 parent 9413fe0 commit 5557213
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]
jobs:
test:
runs-on: [ubuntu-latest]
timeout-minutes: 10
timeout-minutes: 30
strategy:
matrix:
ros_distro: [noetic]
Expand Down
17 changes: 12 additions & 5 deletions test/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,23 @@ def check_msg(self, msg, log, topic):
@staticmethod
def create_vsps():
"""Create virtual serial ports (vsp) for serial driver testing."""
ports = []
f = io.StringIO()
with redirect_stdout(f):
th_vsp = threading.Thread(target=virtualserialports.run, args=(2, False, False))
th_vsp.daemon = True
th_vsp.start()

return f.getvalue().split('\n')[:-1]
rospy.sleep(2.)

while len(ports) < 2:
ports = f.getvalue().split('\n')[:-1]

if len(ports) < 2:
rospy.logwarn('Virtual serial ports not ready yet, waiting...')
rospy.sleep(2.)

return ports

def playback_log(self, launchfile, log):
"""Playback a logfile."""
Expand Down Expand Up @@ -185,12 +195,9 @@ def test(self):
p_roscore = subprocess.Popen(['roscore'], env=env_variables)
rospy.init_node('nmea_navsat_driver_tester')

# init serial handler and wait until vsps are ready
# init serial handler
ports = self.create_vsps()
self.serial_writer = serial.Serial(ports[0], 115200)
while len(ports) < 2:
rospy.logwarn('Virtual serial ports not ready yet, waiting...')
rospy.sleep(.5)

# process all launch files
for launchfile in self.cfg_launches:
Expand Down

0 comments on commit 5557213

Please sign in to comment.