Added logging to pools and workers.

This commit is contained in:
Jay
2026-04-23 20:58:57 -04:00
parent 230e6e608a
commit 0ac8d9facd
11 changed files with 209 additions and 47 deletions
+5 -5
View File
@@ -16,7 +16,7 @@ func TestRunWatchdog(t *testing.T) {
defer cancel()
called := atomic.Bool{}
go RunWatchdog(ctx, func(WorkerExitKind) { called.Store(true) }, heartbeat, 200*time.Millisecond)
go RunWatchdog(ctx, func(WorkerExitKind) { called.Store(true) }, heartbeat, 200*time.Millisecond, nil)
for i := 0; i < 5; i++ {
time.Sleep(20 * time.Millisecond)
@@ -40,7 +40,7 @@ func TestRunWatchdog(t *testing.T) {
count.Add(1)
gotKind = kind
close(done)
}, heartbeat, 20*time.Millisecond)
}, heartbeat, 20*time.Millisecond, nil)
honeybeetest.Eventually(t, func() bool {
select {
@@ -62,7 +62,7 @@ func TestRunWatchdog(t *testing.T) {
called := atomic.Bool{}
done := make(chan struct{})
go func() {
RunWatchdog(ctx, func(WorkerExitKind) { called.Store(true) }, heartbeat, 20*time.Second)
RunWatchdog(ctx, func(WorkerExitKind) { called.Store(true) }, heartbeat, 20*time.Second, nil)
close(done)
}()
@@ -87,7 +87,7 @@ func TestRunWatchdog(t *testing.T) {
called := atomic.Bool{}
done := make(chan struct{})
go func() {
RunWatchdog(ctx, func(WorkerExitKind) { called.Store(true) }, heartbeat, 0)
RunWatchdog(ctx, func(WorkerExitKind) { called.Store(true) }, heartbeat, 0, nil)
close(done)
}()
@@ -112,7 +112,7 @@ func TestRunWatchdog(t *testing.T) {
done := make(chan struct{})
go func() {
RunWatchdog(ctx, func(WorkerExitKind) {}, heartbeat, 0)
RunWatchdog(ctx, func(WorkerExitKind) {}, heartbeat, 0, nil)
close(done)
}()