(t *testing.T)
| 79 | } |
| 80 | |
| 81 | func newTestOlricCluster(t *testing.T) *testOlricCluster { |
| 82 | cl := &testOlricCluster{members: make(map[string]*Olric)} |
| 83 | t.Cleanup(func() { |
| 84 | cl.mtx.Lock() |
| 85 | defer cl.mtx.Unlock() |
| 86 | for _, member := range cl.members { |
| 87 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 88 | err := member.Shutdown(ctx) |
| 89 | cancel() |
| 90 | require.NoError(t, err) |
| 91 | } |
| 92 | }) |
| 93 | return cl |
| 94 | } |
| 95 | |
| 96 | func (cl *testOlricCluster) addMemberWithConfig(t *testing.T, c *config.Config) *Olric { |
| 97 | cl.mtx.Lock() |
no test coverage detected