MCPcopy
hub / github.com/prometheus/prometheus / TestSampleDeliveryTimeout

Function TestSampleDeliveryTimeout

storage/remote/queue_manager_test.go:391–419  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

389}
390
391func TestSampleDeliveryTimeout(t *testing.T) {
392 t.Parallel()
393 for _, protoMsg := range []remoteapi.WriteMessageType{remoteapi.WriteV1MessageType, remoteapi.WriteV2MessageType} {
394 t.Run(fmt.Sprint(protoMsg), func(t *testing.T) {
395 recs := testwal.GenerateRecords(recCase{
396 NoST: protoMsg == remoteapi.WriteV1MessageType, // RW1 does not support ST.
397 Series: 10, SamplesPerSeries: 10,
398 })
399 cfg := testDefaultQueueConfig()
400 mcfg := config.DefaultMetadataConfig
401 cfg.MaxShards = 1
402
403 c := NewTestWriteClient(protoMsg)
404 m := newTestQueueManager(t, cfg, mcfg, defaultFlushDeadline, c, protoMsg)
405 m.StoreSeries(recs.Series, 0)
406 m.Start()
407 defer m.Stop()
408
409 // Send the samples twice, waiting for the samples in the meantime.
410 c.expectSamples(recs.Samples, recs.Series)
411 m.Append(recs.Samples)
412 c.waitForExpectedData(t, 30*time.Second)
413
414 c.expectSamples(recs.Samples, recs.Series)
415 m.Append(recs.Samples)
416 c.waitForExpectedData(t, 30*time.Second)
417 })
418 }
419}
420
421func TestSampleDeliveryOrder(t *testing.T) {
422 t.Parallel()

Callers

nothing calls this directly

Calls 11

expectSamplesMethod · 0.95
waitForExpectedDataMethod · 0.95
GenerateRecordsFunction · 0.92
testDefaultQueueConfigFunction · 0.85
NewTestWriteClientFunction · 0.85
newTestQueueManagerFunction · 0.85
RunMethod · 0.65
StoreSeriesMethod · 0.65
AppendMethod · 0.65
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…