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

Function TestCompactWithConfigUnsupportedVersion

tempodb/compactor_test.go:944–997  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

942}
943
944func TestCompactWithConfigUnsupportedVersion(t *testing.T) {
945 tempDir := t.TempDir()
946
947 // Create backend reader/writer directly to write the block meta
948 localCfg := &local.Config{Path: path.Join(tempDir, "traces")}
949 _, rawW, _, err := local.New(localCfg)
950 require.NoError(t, err)
951 backendW := backend.NewWriter(rawW)
952
953 _, _, c, err := New(&Config{
954 Backend: backend.Local,
955 Pool: &pool.Config{
956 MaxWorkers: 10,
957 QueueDepth: 100,
958 },
959 Local: localCfg,
960 Block: &common.BlockConfig{
961 BloomFP: .01,
962 BloomShardSizeBytes: 100_000,
963 Version: "vParquet4",
964 },
965 WAL: &wal.Config{
966 Filepath: path.Join(tempDir, "wal"),
967 },
968 BlocklistPoll: 0,
969 }, nil, log.NewNopLogger())
970 require.NoError(t, err)
971
972 ctx := context.Background()
973
974 // Create a block meta with an unsupported preview version and write it to storage
975 meta := &backend.BlockMeta{
976 BlockID: backend.NewUUID(),
977 TenantID: testTenantID,
978 Version: "vParquet5-preview6",
979 }
980 err = backendW.WriteBlockMeta(ctx, meta)
981 require.NoError(t, err)
982
983 // Try to compact
984 _, err = c.CompactWithConfig(
985 ctx,
986 []*backend.BlockMeta{meta},
987 testTenantID,
988 &CompactorConfig{
989 MaxCompactionRange: 24 * time.Hour,
990 },
991 &mockSharder{},
992 &mockOverrides{},
993 )
994
995 require.Error(t, err)
996 require.Contains(t, err.Error(), "compaction not supported for block version vParquet5-preview6")
997}

Callers

nothing calls this directly

Calls 8

WriteBlockMetaMethod · 0.95
NewFunction · 0.92
NewWriterFunction · 0.92
NewUUIDFunction · 0.92
NewFunction · 0.70
JoinMethod · 0.65
CompactWithConfigMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected