MCPcopy Index your code
hub / github.com/cortexproject/cortex / TestDisableChunkTrimmingFuzz

Function TestDisableChunkTrimmingFuzz

integration/query_fuzz_test.go:267–422  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

265}
266
267func TestDisableChunkTrimmingFuzz(t *testing.T) {
268 s, err := e2e.NewScenario(networkName)
269 require.NoError(t, err)
270 defer s.Close()
271
272 // Start dependencies.
273 consul1 := e2edb.NewConsulWithName("consul1")
274 consul2 := e2edb.NewConsulWithName("consul2")
275 require.NoError(t, s.StartAndWaitReady(consul1, consul2))
276
277 flags := mergeFlags(
278 AlertmanagerLocalFlags(),
279 map[string]string{
280 "-store.engine": blocksStorageEngine,
281 "-blocks-storage.backend": "filesystem",
282 "-blocks-storage.tsdb.head-compaction-interval": "4m",
283 "-blocks-storage.tsdb.block-ranges-period": "2h",
284 "-blocks-storage.tsdb.ship-interval": "1h",
285 "-blocks-storage.bucket-store.sync-interval": "15m",
286 "-blocks-storage.tsdb.retention-period": "2h",
287 "-blocks-storage.bucket-store.index-cache.backend": tsdb.IndexCacheBackendInMemory,
288 // Ingester.
289 "-ring.store": "consul",
290 // Distributor.
291 "-distributor.replication-factor": "1",
292 // Store-gateway.
293 "-store-gateway.sharding-enabled": "false",
294 // alert manager
295 "-alertmanager.web.external-url": "http://localhost/alertmanager",
296 },
297 )
298
299 // make alert manager config dir
300 require.NoError(t, writeFileToSharedDir(s, "alertmanager_configs", []byte{}))
301
302 path1 := path.Join(s.SharedDir(), "cortex-1")
303 path2 := path.Join(s.SharedDir(), "cortex-2")
304
305 flags1 := mergeFlags(flags, map[string]string{
306 "-blocks-storage.filesystem.dir": path1,
307 "-consul.hostname": consul1.NetworkHTTPEndpoint(),
308 })
309 // Disable chunk trimming for Cortex 2.
310 flags2 := mergeFlags(flags, map[string]string{
311 "-blocks-storage.filesystem.dir": path2,
312 "-consul.hostname": consul2.NetworkHTTPEndpoint(),
313 "-ingester.disable-chunk-trimming": "true",
314 })
315 // Start Cortex replicas.
316 cortex1 := e2ecortex.NewSingleBinary("cortex-1", flags1, "")
317 cortex2 := e2ecortex.NewSingleBinary("cortex-2", flags2, "")
318 require.NoError(t, s.StartAndWaitReady(cortex1, cortex2))
319
320 // Wait until Cortex replicas have updated the ring state.
321 require.NoError(t, cortex1.WaitSumMetrics(e2e.Equals(float64(512)), "cortex_ring_tokens_total"))
322 require.NoError(t, cortex2.WaitSumMetrics(e2e.Equals(float64(512)), "cortex_ring_tokens_total"))
323
324 c1, err := e2ecortex.NewClient(cortex1.HTTPEndpoint(), cortex1.HTTPEndpoint(), "", "", "user-1")

Callers

nothing calls this directly

Calls 15

CloseMethod · 0.95
StartAndWaitReadyMethod · 0.95
SharedDirMethod · 0.95
PushMethod · 0.95
QueryRangeMethod · 0.95
NewScenarioFunction · 0.92
NewSingleBinaryFunction · 0.92
EqualsFunction · 0.92
NewClientFunction · 0.92
writeFileToSharedDirFunction · 0.85
waitUntilReadyFunction · 0.85

Tested by

no test coverage detected