This is an automated email from the ASF dual-hosted git repository.

zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-go.git


The following commit(s) were added to refs/heads/main by this push:
     new 146f999  ci: make additional checks to prevent flaky EOF (#414)
146f999 is described below

commit 146f9991b8690e8737495d5b6483620955f7dbb0
Author: Matt Topol <[email protected]>
AuthorDate: Thu Jun 19 10:35:29 2025 -0400

    ci: make additional checks to prevent flaky EOF (#414)
    
    ### Rationale for this change
    Additional checks for `io.EOF` to avoid flaky tests
---
 arrow/flight/flightsql/example/sql_batch_reader.go                | 3 ++-
 .../flight/flightsql/example/sqlite_tables_schema_batch_reader.go | 8 ++++++--
 arrow/flight/record_batch_reader.go                               | 4 +++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/arrow/flight/flightsql/example/sql_batch_reader.go 
b/arrow/flight/flightsql/example/sql_batch_reader.go
index e0892e0..74444db 100644
--- a/arrow/flight/flightsql/example/sql_batch_reader.go
+++ b/arrow/flight/flightsql/example/sql_batch_reader.go
@@ -21,6 +21,7 @@ package example
 
 import (
        "database/sql"
+       "io"
        "reflect"
        "strconv"
        "strings"
@@ -264,7 +265,7 @@ func (r *SqlBatchReader) Next() bool {
 
        rows := 0
        for rows < maxBatchSize && r.rows.Next() {
-               if err := r.rows.Scan(r.rowdest...); err != nil {
+               if err := r.rows.Scan(r.rowdest...); err != nil && err.Error() 
!= io.EOF.Error() {
                        // Not really useful except for testing Flight SQL 
clients
                        detail := wrapperspb.StringValue{Value: 
r.schema.String()}
                        if st, sterr := status.New(codes.Unknown, 
err.Error()).WithDetails(&detail); sterr != nil {
diff --git 
a/arrow/flight/flightsql/example/sqlite_tables_schema_batch_reader.go 
b/arrow/flight/flightsql/example/sqlite_tables_schema_batch_reader.go
index 55b2390..17ca3c5 100644
--- a/arrow/flight/flightsql/example/sqlite_tables_schema_batch_reader.go
+++ b/arrow/flight/flightsql/example/sqlite_tables_schema_batch_reader.go
@@ -22,6 +22,8 @@ package example
 import (
        "context"
        "database/sql"
+       "errors"
+       "io"
        "strings"
        "sync/atomic"
 
@@ -173,7 +175,9 @@ func (s *SqliteTablesSchemaBatchReader) Next() bool {
                for rows.Next() {
                        if err := rows.Scan(&tableName, &name, &typ, &nn); err 
!= nil {
                                rows.Close()
-                               s.err = err
+                               if err.Error() != io.EOF.Error() {
+                                       s.err = err
+                               }
                                return false
                        }
 
@@ -186,7 +190,7 @@ func (s *SqliteTablesSchemaBatchReader) Next() bool {
                }
 
                rows.Close()
-               if rows.Err() != nil {
+               if rows.Err() != nil && !errors.Is(rows.Err(), io.EOF) {
                        s.err = rows.Err()
                        return false
                }
diff --git a/arrow/flight/record_batch_reader.go 
b/arrow/flight/record_batch_reader.go
index c65d89f..30a5bcb 100644
--- a/arrow/flight/record_batch_reader.go
+++ b/arrow/flight/record_batch_reader.go
@@ -18,7 +18,9 @@ package flight
 
 import (
        "bytes"
+       "errors"
        "fmt"
+       "io"
        "sync/atomic"
 
        "github.com/apache/arrow-go/v18/arrow"
@@ -256,7 +258,7 @@ func ConcatenateReaders(rdrs []array.RecordReader, ch 
chan<- StreamChunk) {
                        ch <- StreamChunk{Data: rec}
                }
                if e, ok := r.(haserr); ok {
-                       if e.Err() != nil {
+                       if e.Err() != nil && !errors.Is(e.Err(), io.EOF) {
                                ch <- StreamChunk{Err: e.Err()}
                                return
                        }

Reply via email to