From 45e435f506801fce19b30480f2fcfc537a67b3d3 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 28 Apr 2023 12:41:01 -0600 Subject: [PATCH] test.pl: Add comment that you should clear watchdog As it says, failure to cancel a timer can lead to failing (or worse: flapping) tests --- t/test.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/t/test.pl b/t/test.pl index 215877f312ba..07dfff8ab909 100644 --- a/t/test.pl +++ b/t/test.pl @@ -1768,6 +1768,21 @@ sub warning_like { # variable in your profile for slow boxes, or use it to override the timeout # temporarily for debugging. # +# It is good practice to CLEAR EVERY WATCHDOG timer. Otherwise the timer +# applies to the entire rest of the file. Even if that works now, new tests +# tend to get added to the end of the file, and people may not notice that +# they are being timed. Those tests may all complete before the timer kills +# them, but then more new tests get added, even further away from the timer +# setting code, with less likelihood of noticing that. Those tests may also +# generally work, but flap on heavily loaded smokers, leading to debugging +# effort that wouldn't have had to be expended if the timer had been cancelled +# in the first place +# +# This will figure out a suitable method to implement the timer, but you can +# force it to use an alarm by setting the optional second parameter to +# 'alarm', or to use a separate process (if available on this platform) by +# setting that parameter to 'process'. +# # NOTE: If the test file uses 'threads', then call the watchdog() function # _AFTER_ the 'threads' module is loaded. { # Closure