Skip to content

Commit fdeda7f

Browse files
committed
guess when graphical error message prevents command from completing
1 parent dc2b35f commit fdeda7f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/arduino_ci/arduino_cmd.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ def run_and_capture(*args)
7676
end
7777

7878
def board_installed?(board)
79-
run("--board", board)
79+
# On Travis CI, we get an error message in the GUI instead of on STDERR
80+
# so, assume that if we don't get a rapid reply that things are not installed
81+
x3 = @prefs_response_time * 3
82+
Timeout.timeout(x3) do
83+
run("--board", board)
84+
end
85+
rescue Timeout::Error
86+
puts "No response in #{x3} seconds. Assuming graphical modal error message about board not installed."
87+
false
8088
end
8189

8290
end

0 commit comments

Comments
 (0)