forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also, plumb through Stop on StorageClient, so the cachingStorageClient can stop its cache. Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
- Loading branch information
Showing
10 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package storage | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/prometheus/common/model" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/cortexproject/cortex/pkg/chunk" | ||
"github.com/cortexproject/cortex/pkg/util" | ||
"github.com/cortexproject/cortex/pkg/util/validation" | ||
) | ||
|
||
func TestFactoryStop(t *testing.T) { | ||
var ( | ||
cfg Config | ||
storeConfig chunk.StoreConfig | ||
schemaConfig chunk.SchemaConfig | ||
defaults validation.Limits | ||
) | ||
util.DefaultValues(&cfg, &storeConfig, &schemaConfig, &defaults) | ||
schemaConfig.Configs = []chunk.PeriodConfig{ | ||
{ | ||
From: model.Time(0), | ||
Store: "inmemory", | ||
}, | ||
{ | ||
From: model.Time(1), | ||
Store: "inmemory", | ||
}, | ||
} | ||
cfg.memcacheClient.Host = "localhost" // Fake address that should at least resolve. | ||
|
||
limits, err := validation.NewOverrides(defaults) | ||
require.NoError(t, err) | ||
|
||
store, err := NewStore(cfg, storeConfig, schemaConfig, limits) | ||
require.NoError(t, err) | ||
|
||
store.Stop() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters