-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pillar/watcher: Make goroutinesMonitor stoppable.
Enable the `goroutinesMonitor` to be stopped via a cancellable context within `GoroutineLeakDetectionParams`, allowing controlled termination of the monitoring goroutine. This change introduces a `MakeStoppable` method to set up a cancellable context and a `Stop` method to trigger the cancellation, allowing tests to end monitoring cleanly. Additionally, `checkStopCondition` was added to periodically check if the goroutine should stop. Updated tests to utilize this functionality, adding verification for proper start and stop messages in the log output, ensuring that the monitor operates correctly in both stoppable and unstoppable modes. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
- Loading branch information
1 parent
4564511
commit 9bf7913
Showing
2 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters