Skip to content

Replace watchdog sleep with interruptable wait for faster teardown#2082

Open
TheRickyZhang wants to merge 1 commit into
google:mainfrom
TheRickyZhang:replace-watchdog-sleep
Open

Replace watchdog sleep with interruptable wait for faster teardown#2082
TheRickyZhang wants to merge 1 commit into
google:mainfrom
TheRickyZhang:replace-watchdog-sleep

Conversation

@TheRickyZhang
Copy link
Copy Markdown

@TheRickyZhang TheRickyZhang commented May 28, 2026

Summary

Make Runtime::Watchdog teardown prompt by replacing the fixed one-second sleep with an interruptible wait. I don't think there is a current issue open regarding this.

The previous loop used absl::SleepFor(absl::Seconds(1)); the destructor set a stop flag and then joined the thread. If the watchdog was mid-sleep, teardown blocked until that sleep returned, so binaries with many tests must unconditionally wait 1s per test at teardown, even if they finish processing before 1 second has passed.

This uses absl::Notification: the destructor's Notify() wakes the watchdog immediately, while WaitForNotificationWithTimeout(absl::Seconds(1)) preserves the existing one-second periodic limit-check cadence.

Testing

  • 30 trivial FUZZ_TESTs in unit mode (FUZZTEST_FUZZ_FOR=0): total wall time 30.0s -> 0.01s (per-test teardown 1000ms -> 0ms).

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.

1 participant