(t *testing.T)
| 412 | } |
| 413 | |
| 414 | func 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 | |
| 434 | func TestGetTokenDistance(t *testing.T) { |
| 435 | tests := map[string]struct { |
nothing calls this directly
no test coverage detected