Skip to content

Commit

Permalink
test(spanner): queries always return at least one partial result set (#…
Browse files Browse the repository at this point in the history
…3305)

Queries will always return at least one partial result set containing the metadata
of the query, even if the query does not return any rows. That was not taken into
account in one of the test cases.

Fixes #3295

Co-authored-by: skuruppu <skuruppu@google.com>
  • Loading branch information
olavloite and skuruppu committed Dec 2, 2020
1 parent bf148ba commit c314f58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spanner/read_test.go
Expand Up @@ -929,6 +929,11 @@ func TestRsdBlockingStates(t *testing.T) {
name: "unConnected -> queueingRetryable",
sql: "SELECT t.key key, t.value value FROM t_mock t",
stateHistory: []resumableStreamDecoderState{queueingRetryable},
want: []*sppb.PartialResultSet{
{
Metadata: kvMeta,
},
},
},
{
// unConnected->queueingRetryable->queueingRetryable
Expand Down Expand Up @@ -1177,7 +1182,7 @@ func TestRsdBlockingStates(t *testing.T) {
mutex.Lock()
defer mutex.Unlock()
if !testEqual(rs, test.want) {
t.Fatalf("received PartialResultSets: \n%v\n, want \n%v\n", rs, test.want)
t.Fatalf("%s: received PartialResultSets: \n%v\n, want \n%v\n", test.name, rs, test.want)
}
// Verify that resumableStreamDecoder's internal buffering is also
// correct.
Expand Down

0 comments on commit c314f58

Please sign in to comment.