MCPcopy
hub / github.com/olric-data/olric / newTestOlricCluster

Function newTestOlricCluster

olric_test.go:81–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

79}
80
81func 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
96func (cl *testOlricCluster) addMemberWithConfig(t *testing.T, c *config.Config) *Olric {
97 cl.mtx.Lock()

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
ShutdownMethod · 0.65

Tested by

no test coverage detected