MCPcopy
hub / github.com/grafana/dskit / TestWaitInstanceState_ExitsAfterActualStateEqualsState

Function TestWaitInstanceState_ExitsAfterActualStateEqualsState

ring/util_test.go:414–432  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

412}
413
414func TestWaitInstanceState_ExitsAfterActualStateEqualsState(t *testing.T) {
415 t.Parallel()
416
417 const (
418 instanceID = "test"
419 timeoutDuration = time.Second
420 )
421
422 ctx, cancel := context.WithTimeout(context.Background(), timeoutDuration)
423 defer cancel()
424
425 ring := &RingMock{}
426 ring.On("GetInstanceState", mock.Anything, mock.Anything).Return(ACTIVE, nil)
427
428 err := WaitInstanceState(ctx, ring, instanceID, ACTIVE)
429
430 assert.Nil(t, err)
431 ring.AssertNumberOfCalls(t, "GetInstanceState", 1)
432}
433
434func TestGetTokenDistance(t *testing.T) {
435 tests := map[string]struct {

Callers

nothing calls this directly

Calls 1

WaitInstanceStateFunction · 0.85

Tested by

no test coverage detected