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

Function TestResultPoolRelease

pkg/parquetquery/pool_test.go:10–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestResultPoolRelease(t *testing.T) {
11 pool := NewResultPool(5)
12
13 // Get a result and populate it with data
14 result1 := pool.Get()
15 result1.AppendValue("key1", parquet.ValueOf("value1"))
16 result1.AppendValue("key2", parquet.ValueOf(42))
17 result1.AppendOtherValue("other1", "othervalue1")
18 result1.AppendOtherValue("other2", 123)
19
20 pool.Release(result1)
21
22 result2 := pool.Get()
23
24 // Verify the IteratorResult is properly cleared
25 assert.Equal(t, 0, len(result2.Entries), "Entries should be empty in reused result")
26 assert.Equal(t, 0, len(result2.OtherEntries), "OtherEntries should be empty in reused result")
27}

Callers

nothing calls this directly

Calls 6

GetMethod · 0.95
ReleaseMethod · 0.95
NewResultPoolFunction · 0.85
AppendValueMethod · 0.80
AppendOtherValueMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected