MCPcopy
hub / github.com/prometheus/prometheus / TestSampleDeliveryOrder

Function TestSampleDeliveryOrder

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

Source from the content-addressed store, hash-verified

419}
420
421func TestSampleDeliveryOrder(t *testing.T) {
422 t.Parallel()
423 for _, protoMsg := range []remoteapi.WriteMessageType{remoteapi.WriteV1MessageType, remoteapi.WriteV2MessageType} {
424 t.Run(fmt.Sprint(protoMsg), func(t *testing.T) {
425 ts := 10
426 n := config.DefaultQueueConfig.MaxSamplesPerSend * ts
427 recs := testwal.GenerateRecords(recCase{
428 NoST: protoMsg == remoteapi.WriteV1MessageType, // RW1 does not support ST.
429 Series: n, SamplesPerSeries: 1,
430 })
431
432 c, m := newTestClientAndQueueManager(t, defaultFlushDeadline, protoMsg)
433 c.expectSamples(recs.Samples, recs.Series)
434 m.StoreSeries(recs.Series, 0)
435
436 m.Start()
437 defer m.Stop()
438 // These should be received by the client.
439 m.Append(recs.Samples)
440 c.waitForExpectedData(t, 30*time.Second)
441 })
442 }
443}
444
445func TestShutdown(t *testing.T) {
446 t.Parallel()

Callers

nothing calls this directly

Calls 9

GenerateRecordsFunction · 0.92
expectSamplesMethod · 0.80
waitForExpectedDataMethod · 0.80
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…