Increase arduino esp timeout (#1620)
* Try increase test timeout. * Update arduino-esp.yml for Azure Pipelines * allow run to end early.
This commit is contained in:
Родитель
ecdef3bbb2
Коммит
41ffe84877
|
@ -38,7 +38,7 @@ jobs:
|
|||
ls
|
||||
cd $(Build.SourcesDirectory)/testtools/UART_interface/
|
||||
echo -e "exit\r\n\r\n\r\n" | cat > input.txt
|
||||
python3 serial_connect.py -i input.txt -o output.txt -b 115200 -p $(ESP8266_PORT) -d esp8266 -s
|
||||
python3 serial_connect.py -i input.txt -o output.txt -b 115200 -p $(ESP8266_PORT) -d esp8266 -s -t 30
|
||||
rm input.txt
|
||||
code=$(<exitcode.txt)
|
||||
exit $code
|
||||
|
@ -96,7 +96,7 @@ jobs:
|
|||
ls
|
||||
cd $(Build.SourcesDirectory)/testtools/UART_interface/
|
||||
echo -e "exit\r\n\r\n\r\n" | cat > input.txt
|
||||
python3 serial_connect.py -i input.txt -o output.txt -b 1000000 -p $(ESP32_PORT) -d esp32 -s
|
||||
python3 serial_connect.py -i input.txt -o output.txt -b 1000000 -p $(ESP32_PORT) -d esp32 -s -t 30
|
||||
rm input.txt
|
||||
code=$(<exitcode.txt)
|
||||
exit $code
|
||||
|
|
|
@ -125,6 +125,7 @@ class esp_uart_interface(uart_interface):
|
|||
serial_settings.bits_to_cache = 1600
|
||||
serial_settings.baud_rate = 115200
|
||||
|
||||
session_start = time.time()
|
||||
if input_file:
|
||||
# set wait between read/write
|
||||
wait = (serial_settings.bits_to_cache/serial_settings.baud_rate)
|
||||
|
@ -150,16 +151,31 @@ class esp_uart_interface(uart_interface):
|
|||
while(output):
|
||||
time.sleep(wait)
|
||||
output = self.serial_read(ser, line, output_file_obj)
|
||||
if "done with sending" in output:
|
||||
serial_settings.tests_run = True
|
||||
line = input_file_obj.readline()
|
||||
|
||||
# read any trailing output, save to file
|
||||
while (ser.in_waiting):
|
||||
time.sleep(.2)
|
||||
output = self.serial_read(ser, line, output_file_obj)
|
||||
if serial_settings.test_timeout:
|
||||
print("Test input end. Waiting for results. Time Elapsed: ", (time.time() - session_start))
|
||||
while((time.time() - session_start) < serial_settings.test_timeout):
|
||||
time.sleep(.2)
|
||||
output = self.serial_read(ser, line, output_file_obj)
|
||||
check_sdk_errors(output)
|
||||
|
||||
#for now we can assume one test suite is run
|
||||
if "done with sending" in output or serial_settings.tests_run:
|
||||
break
|
||||
print("Test iteration ended. Time Elapsed: ", (time.time() - session_start))
|
||||
else:
|
||||
# read any trailing output, save to file
|
||||
while (ser.in_waiting):
|
||||
time.sleep(.2)
|
||||
output = self.serial_read(ser, line, output_file_obj)
|
||||
check_sdk_errors(output)
|
||||
|
||||
# forward failed callbacks to SDK_ERRORS
|
||||
azure_test_firmware_errors.SDK_ERRORS += self.messages_sent - self.message_callbacks
|
||||
with open('exitcode.txt', 'w') as fexit:
|
||||
fexit.write('%d' %azure_test_firmware_errors.SDK_ERRORS)
|
||||
|
||||
output_file_obj.close()
|
||||
output_file_obj.close()
|
||||
|
|
Загрузка…
Ссылка в новой задаче