1
0
mirror of https://github.com/containous/traefik.git synced 2025-01-12 09:17:54 +03:00
traefik/safe/routine_test.go

17 lines
312 B
Go
Raw Normal View History

2016-12-08 15:32:12 +03:00
package safe
import (
"github.com/cenk/backoff"
"testing"
)
func TestOperationWithRecover(t *testing.T) {
operation := func() error {
panic("BOOM")
}
err := backoff.Retry(OperationWithRecover(operation), &backoff.StopBackOff{})
if err == nil {
t.Fatalf("Error in OperationWithRecover: %s", err)
}
}