carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package host
2
3import (
4 "context"
5 "errors"
6 "testing"
7 "time"
8)
9
10func TestPlan9FencePassRetriesPreparation(t *testing.T) {
11 ctx, cancel := context.WithTimeout(t.Context(), time.Second)
12 defer cancel()
13 calls := 0
14 runHostFenceLoop(ctx, time.Millisecond, func(context.Context) error {
15 calls++
16 if calls == 2 {
17 cancel()
18 }
19 return errors.New("credentials unavailable")
20 })
21 if calls != 2 {
22 t.Fatalf("preparation was not retried: %d", calls)
23 }
24}
25