(t *testing.T, appV2 bool)
| 97 | } |
| 98 | |
| 99 | func testNewScrapePool(t *testing.T, appV2 bool) { |
| 100 | var ( |
| 101 | app = teststorage.NewAppendable() |
| 102 | sa = selectAppendable(app, appV2) |
| 103 | cfg = &config.ScrapeConfig{ |
| 104 | MetricNameValidationScheme: model.UTF8Validation, |
| 105 | MetricNameEscapingScheme: model.AllowUTF8, |
| 106 | } |
| 107 | sp, err = newScrapePool(cfg, sa.V1(), sa.V2(), 0, nil, nil, &Options{}, newTestScrapeMetrics(t)) |
| 108 | ) |
| 109 | require.NoError(t, err) |
| 110 | |
| 111 | if appV2 { |
| 112 | a, ok := sp.appendableV2.(*teststorage.Appendable) |
| 113 | require.True(t, ok, "Failure to append.") |
| 114 | require.Equal(t, app, a, "Wrong sample AppenderV2.") |
| 115 | require.Equal(t, cfg, sp.config, "Wrong scrape config.") |
| 116 | |
| 117 | require.Nil(t, sp.appendable) |
| 118 | return |
| 119 | } |
| 120 | a, ok := sp.appendable.(*teststorage.Appendable) |
| 121 | require.True(t, ok, "Failure to append.") |
| 122 | require.Equal(t, app, a, "Wrong sample appender.") |
| 123 | require.Equal(t, cfg, sp.config, "Wrong scrape config.") |
| 124 | |
| 125 | require.Nil(t, sp.appendableV2) |
| 126 | } |
| 127 | |
| 128 | func TestStorageHandlesOutOfOrderTimestamps(t *testing.T) { |
| 129 | foreachAppendable(t, func(t *testing.T, appV2 bool) { |
no test coverage detected
searching dependent graphs…