(ctx context.Context, t *testing.T, store database.Store, agentID uuid.UUID, status database.TailnetStatus)
| 939 | } |
| 940 | |
| 941 | func assertEventuallyStatus(ctx context.Context, t *testing.T, store database.Store, agentID uuid.UUID, status database.TailnetStatus) { |
| 942 | t.Helper() |
| 943 | assert.Eventually(t, func() bool { |
| 944 | peers, err := store.GetTailnetPeers(ctx, agentID) |
| 945 | if xerrors.Is(err, sql.ErrNoRows) { |
| 946 | return false |
| 947 | } |
| 948 | if err != nil { |
| 949 | t.Fatal(err) |
| 950 | } |
| 951 | for _, peer := range peers { |
| 952 | if peer.Status != status { |
| 953 | return false |
| 954 | } |
| 955 | } |
| 956 | return true |
| 957 | }, testutil.WaitShort, testutil.IntervalFast) |
| 958 | } |
| 959 | |
| 960 | func assertEventuallyLost(ctx context.Context, t *testing.T, store database.Store, agentID uuid.UUID) { |
| 961 | t.Helper() |
no test coverage detected