From 056b2fde7f432e253856762e61fbf9da9d4e4f01 Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Tue, 20 Nov 2018 21:28:26 +0000 Subject: [PATCH 1/2] Add support for dynamic timeout set/adjust from DUT via {{__timeout_set}}, {{__timeout_adjust}} --- mbed_host_tests/host_tests_runner/host_test_default.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mbed_host_tests/host_tests_runner/host_test_default.py b/mbed_host_tests/host_tests_runner/host_test_default.py index 9cf5f92..20e3496 100644 --- a/mbed_host_tests/host_tests_runner/host_test_default.py +++ b/mbed_host_tests/host_tests_runner/host_test_default.py @@ -433,6 +433,14 @@ def process_code_coverage(key, value, timestamp): self.logger.prn_inf("%s received"% (key)) callbacks__exit_event_queue = True break + elif key == '__timeout_set': + # Dynamic timeout set + timeout_duration = int(value) # New timeout + self.logger.prn_inf("setting timeout to: %d sec"% int(value)) + elif key == '__timeout_adj': + # Dynamic timeout adjust + timeout_duration = timeout_duration + int(value) # adjust time + self.logger.prn_inf("adjusting timeout with %d sec (now %d)" % (int(value), timeout_duration)) elif key in callbacks: # Handle callback callbacks[key](key, value, timestamp) From 5090b13cea664b7953d5542dd167adcd142dd20b Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Sat, 1 Dec 2018 01:49:04 +0000 Subject: [PATCH 2/2] Adjust the "adj" to "adjust" in "__timeout_adjust" As suggested by @bridadan --- mbed_host_tests/host_tests_runner/host_test_default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mbed_host_tests/host_tests_runner/host_test_default.py b/mbed_host_tests/host_tests_runner/host_test_default.py index 20e3496..3159752 100644 --- a/mbed_host_tests/host_tests_runner/host_test_default.py +++ b/mbed_host_tests/host_tests_runner/host_test_default.py @@ -437,7 +437,7 @@ def process_code_coverage(key, value, timestamp): # Dynamic timeout set timeout_duration = int(value) # New timeout self.logger.prn_inf("setting timeout to: %d sec"% int(value)) - elif key == '__timeout_adj': + elif key == '__timeout_adjust': # Dynamic timeout adjust timeout_duration = timeout_duration + int(value) # adjust time self.logger.prn_inf("adjusting timeout with %d sec (now %d)" % (int(value), timeout_duration))