func TestQueryConsumedHalfway_RetryContainsMoreResults_CommitAborted(t *testing.T) {
	testRetryReadWriteTransactionWithQuery(t, func(server testutil.InMemSpannerServer) {
		server.PutExecutionTime(testutil.MethodCommitTransaction, testutil.SimulatedExecutionTime{
			Errors: []error{status.Error(codes.Aborted, "Aborted")},
		})
	}, codes.OK, 2, 2, 2,
		func(server testutil.InMemSpannerServer) {
			server.PutStatementResult(testutil.SelectFooFromBar, &testutil.StatementResult{
				Type:      testutil.StatementResultResultSet,
				ResultSet: testutil.CreateSingleColumnResultSet([]int64{1, 2, 3}, "FOO"),
			})
		}, nil)
}
// TestQueryConsumedHalfway_RetryContainsMoreResults_CommitAborted tests the
// following scenario:
// 1. The initial attempt returns 2 rows. The application fetches the 2 rows,
//    but does not try to fetch a 3 row. It therefore does not know that the
//    iterator only contains 2 rows and not more.
// 2. The retry attempt returns 3 rows. The retry will also only fetch the 2
//    first rows, and as the initial attempt did not know what was after these
//    2 rows the retry should succeed.
TestQueryConsumedHalfway_RetryContainsMoreResults_CommitAborted tests the
following scenario:
1. The initial attempt returns 2 rows. The application fetches the 2 rows,
but does not try to fetch a 3 row. It therefore does not know that the
iterator only contains 2 rows and not more.
2. The retry attempt returns 3 rows. The retry will also only fetch the 2
first rows, and as the initial attempt did not know what was after these
2 rows the retry should succeed.
// TestQueryConsumedHalfway_RetryContainsMoreResults_CommitAborted tests the // following scenario : // 1 . The initial attempt returns 2 rows . The application fetches the 2 rows // but does not try to fetch a 3 row . It therefore does not know that the // iterator only contains 2 rows and not more . // 2 . The retry attempt returns 3 rows . The retry will also only fetch the 2 // first rows and as the initial attempt did not know what was after these // 2 rows the retry should succeed .
func TestQueryConsumedHalfway_RetryContainsMoreResults_CommitAborted(t *testing.T) {
	testRetryReadWriteTransactionWithQuery(t, func(server testutil.InMemSpannerServer) {
		server.PutExecutionTime(testutil.MethodCommitTransaction, testutil.SimulatedExecutionTime{
			Errors: []error{status.Error(codes.Aborted, "Aborted")},
		})
	}, codes.OK, 2, 2, 2,
		func(server testutil.InMemSpannerServer) {
			server.PutStatementResult(testutil.SelectFooFromBar, &testutil.StatementResult{
				Type:      testutil.StatementResultResultSet,
				ResultSet: testutil.CreateSingleColumnResultSet([]int64{1, 2, 3}, "FOO"),
			})
		}, nil)
}
func TestQueryConsumedHalfway_RetryContainsMoreResults_CommitAborted ( t * testing . T ) { testRetryReadWriteTransactionWithQuery ( t , func ( server testutil . InMemSpannerServer ) { server . PutExecutionTime ( testutil . MethodCommitTransaction , testutil . SimulatedExecutionTime { Errors : [ ] error { status . Error ( codes . Aborted , " " ) } , } ) } , codes . OK , 2 , 2 , 2 , func ( server testutil . InMemSpannerServer ) { server . PutStatementResult ( testutil . SelectFooFromBar , & testutil . StatementResult { Type : testutil . StatementResultResultSet , ResultSet : testutil . CreateSingleColumnResultSet ( [ ] int64 { 1 , 2 , 3 } , " " ) , } ) } , nil ) }
TestQueryConsumedHalfway_RetryContainsMoreResults_CommitAborted tests the
following scenario:
1.
TestQueryConsumedHalfway_RetryContainsMoreResults_CommitAborted tests the following scenario : 1 .