(t *testing.T)
| 206 | } |
| 207 | |
| 208 | func TestSyncIteratorPropagatesErrors(t *testing.T) { |
| 209 | type T struct{ A int } |
| 210 | |
| 211 | rows := []T{} |
| 212 | count := 10_000 |
| 213 | for i := 0; i < count; i++ { |
| 214 | rows = append(rows, T{i}) |
| 215 | } |
| 216 | |
| 217 | ctx, cancel := context.WithCancel(context.Background()) |
| 218 | |
| 219 | pf := createFileWith(t, ctx, rows) |
| 220 | |
| 221 | iter := NewSyncIterator(ctx, pf.RowGroups(), 0) |
| 222 | |
| 223 | _, err := iter.Next() |
| 224 | require.NoError(t, err) |
| 225 | |
| 226 | cancel() |
| 227 | |
| 228 | // iterate until we get an error and confirm it's because of the context cancellation |
| 229 | for { |
| 230 | _, err = iter.Next() |
| 231 | if err != nil { |
| 232 | break |
| 233 | } |
| 234 | } |
| 235 | require.ErrorContains(t, err, "context canceled") |
| 236 | } |
| 237 | |
| 238 | func BenchmarkColumnIterator(b *testing.B) { |
| 239 | for _, tc := range iterTestCases { |
nothing calls this directly
no test coverage detected