Skip to content

Commit

Permalink
Merge pull request #218 from googleapis/stream-reset-fix
Browse files Browse the repository at this point in the history
fix: update another conformance test to determine if request is full table scan
  • Loading branch information
mutianf authored Dec 12, 2024
2 parents db4d6a9 + 5c718d0 commit c78ca18
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/readrows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package tests
import (
"fmt"
"net/url"
"reflect"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -460,7 +461,13 @@ func TestReadRows_Retry_StreamReset(t *testing.T) {
assert.Equal(t, 2, len(recorder))
loggedReq := <-recorder
loggedRetry := <-recorder
assert.Empty(t, loggedReq.req.GetRows().GetRowRanges())
if reflect.TypeOf(loggedReq.req.GetRows().GetRowRanges()).Kind() == reflect.Slice {
// Check if rows or row ranges are present in requests. This is a workaround for the NodeJS client.
// In Node we add an empty row range to a full table scan request to simplify the resumption logic.
assert.Empty(t, 0, len(loggedReq.req.GetRows().GetRowRanges()))
} else {
assert.Empty(t, loggedReq.req.GetRows().GetRowRanges())
}
assert.True(t, cmp.Equal(loggedRetry.req.GetRows().GetRowRanges()[0].StartKey, &btpb.RowRange_StartKeyOpen{StartKeyOpen: []byte("abar")}))
}

Expand Down

0 comments on commit c78ca18

Please sign in to comment.