MCPcopy
hub / github.com/grafana/tempo / TestPollBlock

Function TestPollBlock

tempodb/blocklist/poller_test.go:297–389  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

295}
296
297func TestPollBlock(t *testing.T) {
298 one := backend.MustParse("00000000-0000-0000-0000-000000000001")
299
300 tests := []struct {
301 name string
302 list PerTenant
303 compactedList PerTenantCompacted
304 pollTenantID string
305 pollBlockID backend.UUID
306 expectedMeta *backend.BlockMeta
307 expectedCompactedMeta *backend.CompactedBlockMeta
308 expectsError bool
309 }{
310 {
311 name: "block and tenant don't exist",
312 pollTenantID: "test",
313 pollBlockID: one,
314 },
315 {
316 name: "block exists",
317 pollTenantID: "test",
318 pollBlockID: one,
319 list: PerTenant{
320 "test": []*backend.BlockMeta{
321 {
322 BlockID: one,
323 },
324 },
325 },
326 expectedMeta: &backend.BlockMeta{
327 BlockID: one,
328 },
329 },
330 {
331 name: "compactedblock exists",
332 pollTenantID: "test",
333 pollBlockID: one,
334 compactedList: PerTenantCompacted{
335 "test": []*backend.CompactedBlockMeta{
336 {
337 BlockMeta: backend.BlockMeta{
338 BlockID: one,
339 },
340 },
341 },
342 },
343 expectedCompactedMeta: &backend.CompactedBlockMeta{
344 BlockMeta: backend.BlockMeta{
345 BlockID: one,
346 },
347 },
348 },
349 {
350 name: "errors",
351 pollTenantID: "test",
352 pollBlockID: one,
353 compactedList: PerTenantCompacted{
354 "test": []*backend.CompactedBlockMeta{

Callers

nothing calls this directly

Calls 8

pollBlockMethod · 0.95
MustParseFunction · 0.92
newMockCompactorFunction · 0.85
newMockReaderFunction · 0.85
NewPollerFunction · 0.85
ErrorMethod · 0.65
RunMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected