Skip to content

Commit

Permalink
test.pl: Add comment that you should clear watchdog
Browse files Browse the repository at this point in the history
As it says, failure to cancel a timer can lead to failing (or worse:
flapping) tests
  • Loading branch information
khwilliamson committed Jul 4, 2023
1 parent 7471907 commit 45e435f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions t/test.pl
Expand Up @@ -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
Expand Down

0 comments on commit 45e435f

Please sign in to comment.