(t *testing.T)
| 743 | } |
| 744 | |
| 745 | func TestLifecycler_NilFlushTransferer(t *testing.T) { |
| 746 | t.Parallel() |
| 747 | |
| 748 | ringStore, closer := consul.NewInMemoryClient(GetCodec(), log.NewNopLogger(), nil) |
| 749 | t.Cleanup(func() { assert.NoError(t, closer.Close()) }) |
| 750 | |
| 751 | var ringConfig Config |
| 752 | flagext.DefaultValues(&ringConfig) |
| 753 | ringConfig.KVStore.Mock = ringStore |
| 754 | lifecyclerConfig := testLifecyclerConfig(ringConfig, "ing1") |
| 755 | |
| 756 | // Create a lifecycler with nil FlushTransferer to make sure it operates correctly |
| 757 | lifecycler, err := NewLifecycler(lifecyclerConfig, nil, "ingester", ringKey, true, log.NewNopLogger(), nil) |
| 758 | require.NoError(t, err) |
| 759 | require.NoError(t, services.StartAndAwaitRunning(context.Background(), lifecycler)) |
| 760 | |
| 761 | // Ensure the lifecycler joined the ring |
| 762 | test.Poll(t, time.Second, 1, func() interface{} { |
| 763 | return lifecycler.HealthyInstancesCount() |
| 764 | }) |
| 765 | |
| 766 | require.NoError(t, services.StopAndAwaitTerminated(context.Background(), lifecycler)) |
| 767 | |
| 768 | assert.Equal(t, 0, lifecycler.HealthyInstancesCount()) |
| 769 | } |
| 770 | |
| 771 | func TestLifecycler_TwoRingsWithDifferentKeysOnTheSameKVStore(t *testing.T) { |
| 772 | t.Parallel() |
nothing calls this directly
no test coverage detected