Skip to content

Commit e29dc18

Browse files
committed
Fix test compatibility with NewRecordReader API change
NewRecordReader now returns (reader, error) instead of just reader. Updated all 4 test cases to handle the error return value.
1 parent a245255 commit e29dc18

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/query/multiple_filters_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,8 @@ func TestStackFilterFunctionNameStartsWith(t *testing.T) {
14761476

14771477
// Validate the remaining samples contain at least one function starting with "app."
14781478
for _, rec := range recs {
1479-
r := profile.NewRecordReader(rec)
1479+
r, err := profile.NewRecordReader(rec)
1480+
require.NoError(t, err)
14801481
for i := 0; i < int(rec.NumRows()); i++ {
14811482
lOffsetStart, lOffsetEnd := r.Locations.ValueOffsets(i)
14821483
firstStart, _ := r.Lines.ValueOffsets(int(lOffsetStart))
@@ -1546,7 +1547,8 @@ func TestStackFilterFunctionNameNotStartsWith(t *testing.T) {
15461547

15471548
// Validate none of the remaining samples contain functions starting with "database."
15481549
for _, rec := range recs {
1549-
r := profile.NewRecordReader(rec)
1550+
r, err := profile.NewRecordReader(rec)
1551+
require.NoError(t, err)
15501552
for i := 0; i < int(rec.NumRows()); i++ {
15511553
lOffsetStart, lOffsetEnd := r.Locations.ValueOffsets(i)
15521554
firstStart, _ := r.Lines.ValueOffsets(int(lOffsetStart))
@@ -1611,7 +1613,8 @@ func TestFrameFilterFunctionNameStartsWith(t *testing.T) {
16111613

16121614
// Validate the remaining frames all start with "runtime."
16131615
for _, rec := range recs {
1614-
r := profile.NewRecordReader(rec)
1616+
r, err := profile.NewRecordReader(rec)
1617+
require.NoError(t, err)
16151618
for i := 0; i < int(rec.NumRows()); i++ {
16161619
lOffsetStart, lOffsetEnd := r.Locations.ValueOffsets(i)
16171620
firstStart, _ := r.Lines.ValueOffsets(int(lOffsetStart))
@@ -1679,7 +1682,8 @@ func TestFrameFilterFunctionNameNotStartsWith(t *testing.T) {
16791682

16801683
// Validate none of the remaining frames start with "runtime."
16811684
for _, rec := range recs {
1682-
r := profile.NewRecordReader(rec)
1685+
r, err := profile.NewRecordReader(rec)
1686+
require.NoError(t, err)
16831687
for i := 0; i < int(rec.NumRows()); i++ {
16841688
lOffsetStart, lOffsetEnd := r.Locations.ValueOffsets(i)
16851689
firstStart, _ := r.Lines.ValueOffsets(int(lOffsetStart))

0 commit comments

Comments
 (0)