Skip to content

Conversation

khwilliamson
Copy link
Contributor

In doing follow up work to a7f3f23
"Turn off watchdog when done in tests", I realized that my solution was
suboptimal, and that the code already existed in test.pl to do things
better.

What that code does is to create an END block to cancel the watchdog
upon program exit. I think that is a better solution than to force
the addition of explicit calls to watchdog(0). This commit creates a
standard way to specify the code that does the cancellation, and to use
it, not only when the END block does, but also when the timer is
explicitly cancelled.

This means the calls to watchdog(0) that occur at the end of the file
that were added in a7f3f23 aren't
necessary. The END block takes care of it. The reason to keep them is
if we want to add a porting test that every watchdog is cleared.

  • This set of changes does not require a perldelta entry.

In doing follow up work to a7f3f23
"Turn off watchdog when done in tests", I realized that my solution was
suboptimal, and that the code already existed in test.pl to do things
better.

What that code does is to create an END block to cancel the watchdog
upon program exit.  I think that is a better solution than to force
the addition of explicit calls to watchdog(0).  This commit creates a
standard way to specify the code that does the cancellation, and to use
it, not only when the END block does, but also when the timer is
explicitly cancelled.

This means the calls to watchdog(0) that occur at the end of the file
that were added in a7f3f23 aren't
necessary.  The END block takes care of it.  The reason to keep them is
if we want to add a porting test that every watchdog is cleared.
The previous commit made these unnecessary.  This commit removes them.
I also removed a couple that occurred just before done_testing() and
plan() that occur at the end of the program.
@@ -2022,6 +2009,9 @@ ($;$)
kill($sig, $pid_to_kill);
});

$cancel_string =~ s/HERE/$watchdog_thread->kill('KILL')->detach()/;
Copy link
Contributor

Choose a reason for hiding this comment

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

$watchdog_thread would be replaced at this point, producing code like threads=SCALAR(0x55e3bd6a7ab0)->kill('KILL')->detach() which will just fail to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants