<p><b>@aabadie</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11252#discussion_r324051261">tests/periph_wdt/tests/01-run.py</a>:</p>
<pre style='color:#555'>> +from testrunner import run
+
+# We test only up to 10ms, with smaller times mcu doesn't have time to
+# print system time before resetting
+reset_times_ms = [1e2, 5e2, 1e3, 5e3]
+
+# We don't check for accuracy, only order of magnitude. Some MCU use an
+# an internal un-calibrated clock as reference which can deviate in
+# more than 50% from theoretical values (e.g STM32 board CLOCK_LSI)
+error_margin = 0.5
+
+
+def get_reset_time(child):
+    reset_time = 0
+    try:
+        while True:
</pre>
<p>I had the case where this ended up in an endless loop (because the boards was resetting too fast ?), preventing the python script to exits. This seems more robust:</p>
⬇️ Suggested change
<pre style="color: #555">-        while True:
+        now = time.time()
+        timeout = 10  # seconds
+        while time.time() < now + timeout:
+            child.expect(u"reset time: (\d+) us", timeout=1)
+            reset_time = int(child.match.group(1))
+        else:
+            # timeout
+            return reset_time
</pre>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11252?email_source=notifications&email_token=ABE7WYG764B6O5FVLWNWL73QJMXTHA5CNFSM4HAVQX4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCET7OZA#pullrequestreview-287831908">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYBGPHJF73Z3YCYGXADQJMXTHANCNFSM4HAVQX4A">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYEGZ4DAG3ISQEPSWADQJMXTHA5CNFSM4HAVQX4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCET7OZA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11252?email_source=notifications\u0026email_token=ABE7WYG764B6O5FVLWNWL73QJMXTHA5CNFSM4HAVQX4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCET7OZA#pullrequestreview-287831908",
"url": "https://github.com/RIOT-OS/RIOT/pull/11252?email_source=notifications\u0026email_token=ABE7WYG764B6O5FVLWNWL73QJMXTHA5CNFSM4HAVQX4KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCET7OZA#pullrequestreview-287831908",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>