google-cloud-go icon indicating copy to clipboard operation
google-cloud-go copied to clipboard

fix(bigtable): Accept nil RowSet to read all rows

Open bhshkh opened this issue 1 year ago • 0 comments

Issue: Conformance test failure at line

https://github.com/googleapis/cloud-bigtable-clients-test/blob/6b9ab96df64cf63898f8c1682a7e316aa23ef1b8/tests/readrows_test.go#L451-L453

:

=== RUN   TestReadRows_Retry_StreamReset
[Servr log] 2024/01/29 13:30:46 There is 10s sleep on the server side
    readrows_test.go:453: 
        	Error Trace:	cloud-bigtable-clients-test/tests/readrows_test.go:453
        	Error:      	Should be empty, but was []
        	Test:       	TestReadRows_Retry_StreamReset
--- FAIL: TestReadRows_Retry_StreamReset (5.42s)
FAIL
exit status 1
FAIL	github.com/googleapis/cloud-bigtable-clients-test/tests	5.906s

Cause:

In a read rows request, a row set can be passed to specify which rows need to be read. E.g.: https://github.com/googleapis/cloud-bigtable-clients-test/blob/6b9ab96df64cf63898f8c1682a7e316aa23ef1b8/tests/readrows_test.go#L485-L491

In the TestReadRows_Retry_StreamReset test, no row set has been specified: https://github.com/googleapis/cloud-bigtable-clients-test/blob/6b9ab96df64cf63898f8c1682a7e316aa23ef1b8/tests/readrows_test.go#L436 In such cases, when the client library receives the read row request, it should not pass any RowSet in the ReadRows RPC call to Bigtable service.

But the Go test proxy creates infinite range and calls the ReadRows method.

Fix:

  • Allow ReadRows to accept nil RowSet
  • Stop sending infinite range from Go test proxy

Logs after fix:

=== RUN   TestReadRows_Retry_StreamReset
[Servr log] 2024/01/29 13:31:27 There is 10s sleep on the server side
--- PASS: TestReadRows_Retry_StreamReset (5.48s)
PASS
ok  	github.com/googleapis/cloud-bigtable-clients-test/tests	6.992s

bhshkh avatar Jan 29 '24 21:01 bhshkh