(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func TestShutdownLeavesTenantsWithBlocks(t *testing.T) { |
| 84 | r, w, _, err := New(&Config{ |
| 85 | Path: t.TempDir(), |
| 86 | }) |
| 87 | require.NoError(t, err) |
| 88 | |
| 89 | ctx := context.Background() |
| 90 | blockID := backend.NewUUID() |
| 91 | contents := bytes.NewReader([]byte("test")) |
| 92 | tenant := "fake" |
| 93 | |
| 94 | // write a "block" |
| 95 | err = w.Write(ctx, "test", backend.KeyPathForBlock((uuid.UUID)(blockID), tenant), contents, contents.Size(), nil) |
| 96 | require.NoError(t, err) |
| 97 | |
| 98 | tenantExists(t, tenant, r) |
| 99 | blockExists(t, blockID, tenant, r) |
| 100 | |
| 101 | // shutdown the backend |
| 102 | r.Shutdown() |
| 103 | |
| 104 | tenantExists(t, tenant, r) |
| 105 | blockExists(t, blockID, tenant, r) |
| 106 | } |
| 107 | |
| 108 | func TestShutdownRemovesTenantsWithoutBlocks(t *testing.T) { |
| 109 | r, w, c, err := New(&Config{ |
nothing calls this directly
no test coverage detected