package host import ( "context" "errors" "testing" "time" ) func TestPlan9FencePassRetriesPreparation(t *testing.T) { ctx, cancel := context.WithTimeout(t.Context(), time.Second) defer cancel() calls := 0 runHostFenceLoop(ctx, time.Millisecond, func(context.Context) error { calls++ if calls == 2 { cancel() } return errors.New("credentials unavailable") }) if calls != 2 { t.Fatalf("preparation was not retried: %d", calls) } }