(new): v1.2 release
Golang lint / lint (push) Successful in 11m32s

This commit is contained in:
2026-08-19 14:58:25 +03:00
parent f03a081ed6
commit 29b208eeec
79 changed files with 7301 additions and 2060 deletions
+28
View File
@@ -18,6 +18,34 @@ func TestWorkerPoolSubmitAfterStop(t *testing.T) {
}
}
func TestWorkerPoolRecoversTaskPanicAndContinues(t *testing.T) {
pool := newWorkerPool(1, 2)
pool.start()
defer pool.stop()
panicked, err := pool.submit(context.Background(), func(context.Context) (any, error) {
panic("boom")
})
if err != nil {
t.Fatalf("submit panic task returned error: %v", err)
}
result := <-panicked
if !errors.Is(result.err, ErrPoolWorkerPanic) {
t.Fatalf("expected ErrPoolWorkerPanic, got %v", result.err)
}
continued, err := pool.submit(context.Background(), func(context.Context) (any, error) {
return "ok", nil
})
if err != nil {
t.Fatalf("submit follow-up returned error: %v", err)
}
result = <-continued
if result.err != nil || result.value != "ok" {
t.Fatalf("worker did not continue: %#v", result)
}
}
func TestWorkerPoolQueueFull(t *testing.T) {
pool := newWorkerPool(1, 1)
pool.start()