Skip to content

Conversation

khwilliamson
Copy link
Contributor

If you set a watchdog timer, you should clear it when its no longer needed. Otherwise it can go off, aborting your test script.

In these more than two dozen test files, it hasn't mostly been a problem because the script finishes before the timer goes off. But I bet that some heisenbugs have been the result of not clearing it.

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

@tonycoz
Copy link
Contributor

tonycoz commented Aug 27, 2025

The test.pl currently shipped with IO (and I think threads, threads-shared) don't treat $timeout == 0 specially.

@tonycoz
Copy link
Contributor

tonycoz commented Sep 1, 2025

The test.pl currently shipped with IO (and I think threads, threads-shared) don't treat $timeout == 0 specially.

This hasn't been addressed.

On Win32 I could see this leading to a race between the child process spinning up (with a timeout of zero) and the test process exiting.

Right now Porting/test-dist-modules.pl embeds the version of test.pl that ships with IO since the blead test.pl isn't backward compatible (or wasn't), so it may be possible to switch it to use that, and hope the IO/threads/threads-shared packagers package the blead test.pl instead of the old version.

If you set a watchdog timer, you should clear it when its no longer
needed.  Otherwise it can go off, aborting your test script.

In these twenty test files, it hasn't mostly been a problem because the
script finishes before the timer goes off.  But I bet that some
heisenbugs have been the result of not clearing it.

It actually shouldn't be necessary to clear the timer when that is the
final statement in the test file, but we may want to add a porting test
that makes sure watchdogs are cleared, and always adding a clear enables
such a test to properly work.
@khwilliamson
Copy link
Contributor Author

For this p.r., I removed the changes to IO and threads

@khwilliamson khwilliamson merged commit a7f3f23 into Perl:blead Sep 3, 2025
33 checks passed
@khwilliamson khwilliamson deleted the watchdog branch September 3, 2025 16:02
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