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

Function TestShutdownLeavesTenantsWithBlocks

tempodb/backend/local/local_test.go:83–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func 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
108func TestShutdownRemovesTenantsWithoutBlocks(t *testing.T) {
109 r, w, c, err := New(&Config{

Callers

nothing calls this directly

Calls 8

NewUUIDFunction · 0.92
KeyPathForBlockFunction · 0.92
tenantExistsFunction · 0.85
blockExistsFunction · 0.85
NewFunction · 0.70
WriteMethod · 0.65
SizeMethod · 0.65
ShutdownMethod · 0.65

Tested by

no test coverage detected