Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mbed_host_tests/host_tests_runner/host_test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The beginning of the test (the "preamble" as its referred to at the top of this file) sets the timeout of the test with the __timeout key. I'd say go ahead and reuse that key instead of making a new one, unless you have any objections.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The __timeout key at "preamble" stage also sets the global timer to 0 and timeout duration. The behavior of __timer_set only sets the timeout duration, but doesn't change the global timer (e.g. time elapsed). I'd prefer not to confuse these two different behaviors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very good point, thanks very much for clarifying 😄

# Dynamic timeout set
timeout_duration = int(value) # New timeout
self.logger.prn_inf("setting timeout to: %d sec"% int(value))
elif key == '__timeout_adjust':
# Dynamic timeout adjust
timeout_duration = timeout_duration + int(value) # adjust time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was about to ask "what's the difference between adjust and set, but this was simple enough :)

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)
Expand Down