(t *testing.T)
| 496 | } |
| 497 | |
| 498 | func TestCompactionFailWillCleanUpTempDir(t *testing.T) { |
| 499 | compactor, err := NewLeveledCompactor(context.Background(), nil, promslog.NewNopLogger(), []int64{ |
| 500 | 20, |
| 501 | 60, |
| 502 | 240, |
| 503 | 720, |
| 504 | 2160, |
| 505 | }, nil, nil) |
| 506 | require.NoError(t, err) |
| 507 | |
| 508 | tmpdir := t.TempDir() |
| 509 | |
| 510 | require.Error(t, compactor.write(tmpdir, &BlockMeta{}, DefaultBlockPopulator{}, erringBReader{})) |
| 511 | _, err = os.Stat(filepath.Join(tmpdir, BlockMeta{}.ULID.String()) + tmpForCreationBlockDirSuffix) |
| 512 | require.True(t, os.IsNotExist(err), "directory is not cleaned up") |
| 513 | } |
| 514 | |
| 515 | func metaRange(name string, mint, maxt int64, stats *BlockStats) dirMeta { |
| 516 | meta := &BlockMeta{MinTime: mint, MaxTime: maxt} |
nothing calls this directly
no test coverage detected
searching dependent graphs…