Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit fd16118

Browse files
authored
bug: deflake rollback integration test (#1164)
The integration test for `Client::Rollback()` was not retrying all `ABORTED` errors.
1 parent 10c27eb commit fd16118

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

google/cloud/spanner/integration_tests/client_integration_test.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,16 @@ TEST_F(ClientIntegrationTest, TransactionRollback) {
200200

201201
std::vector<RowType> returned_rows;
202202
int row_number = 0;
203+
Status iteration_status;
203204
for (auto& row : StreamOf<RowType>(rows)) {
204-
if (!row) break;
205+
if (!row) {
206+
iteration_status = std::move(row).status();
207+
break;
208+
}
205209
SCOPED_TRACE("Parsing row[" + std::to_string(row_number++) + "]");
206210
returned_rows.push_back(*std::move(row));
207211
}
212+
if (iteration_status.code() == StatusCode::kAborted) continue;
208213
ASSERT_THAT(returned_rows, UnorderedElementsAre(
209214
RowType(1, "test-fname-1", "test-lname-1"),
210215
RowType(2, "test-fname-2", "test-lname-2"),

0 commit comments

Comments
 (0)