Skip to content

Spanner: 'test_transaction_batch_update_and_execute_dml' systest flakes with 'None' status code. #9534

Description

@tseaver

Similar to #7504, but this time the status code is None.

From this CI failure:

_________TestSessionAPI.test_transaction_batch_update_and_execute_dml_________self=<tests.system.test_system.TestSessionAPItestMethod=test_transaction_batch_update_and_execute_dml>deftest_transaction_batch_update_and_execute_dml(self):
retry=RetryInstanceState(_has_all_ddl)
retry(self._db.reload)()
session=self._db.session()
session.create()
self.to_delete.append(session)
withsession.batch() asbatch:
batch.delete(self.TABLE, self.ALL)
insert_statements=list(self._generate_insert_statements())
update_statements= [
(
"UPDATE contacts SET email = @email ""WHERE contact_id = @contact_id;",
{"contact_id": 1, "email": "phreddy@example.com"},
{"contact_id": Type(code=INT64), "email": Type(code=STRING)},
)
]
delete_statement="DELETE contacts WHERE TRUE;"defunit_of_work(transaction, self):
rows=list(transaction.read(self.TABLE, self.COLUMNS, self.ALL))
self.assertEqual(rows, [])
status, row_counts=transaction.batch_update(
insert_statements+update_statements
)
self._check_batch_status(status.code)
self.assertEqual(len(row_counts), len(insert_statements) +1)
forrow_countinrow_counts:
self.assertEqual(row_count, 1)
row_count=transaction.execute_update(delete_statement)
self.assertEqual(row_count, len(insert_statements))
>session.run_in_transaction(unit_of_work, self)
tests/system/test_system.py:874:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
google/cloud/spanner_v1/session.py:299: inrun_in_transactionreturn_value=func(txn, *args, **kw)
tests/system/test_system.py:865: inunit_of_workself._check_batch_status(status.code)
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
status_code=10@staticmethoddef_check_batch_status(status_code):
ifstatus_code!=code_pb2.OK:
>raiseexceptions.from_grpc_status(status_code, "batch_update failed")
Egoogle.api_core.exceptions.GoogleAPICallError: Nonebatch_updatefailed

Metadata

Metadata

Labels

api: spannerIssues related to the Spanner API.flakytestingtype: processA process-related concern. May include testing, release, or the like.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions