Skip to content

tests.system.test_session_api: test_transaction_execute_update_dml_returning failed #1013

@flaky-bot

Description

@flaky-bot

Note: #929 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.


commit: 498dba2
buildURL: Build Status, Sponge
status: failed

Test output
args = (session: "projects/precise-truck-742/instances/google-cloud-1696066739495/databases/test_sessions_1696067049334/sessi..., \'wylma@example.com\') RETURNING contact_id, first_name, last_name, email"
params {
}
seqno: 2
request_options {
}
,)
kwargs = {'metadata': [('google-cloud-resource-prefix', 'projects/precise-truck-742/instances/google-cloud-1696066739495/databa...TzWm7y9JBFrdQN9IGMYg'), ('x-goog-api-client', 'gl-python/3.8.13 grpc/1.59.0 gax/2.12.0 gccl/3.40.1')], 'timeout': 30.0}
@functools.wraps(callable_)
def error_remapped_callable(*args, **kwargs):
    try:
      return callable_(*args, **kwargs)

.nox/system-3-8-database_dialect-postgresql/lib/python3.8/site-packages/google/api_core/grpc_helpers.py:75:


.nox/system-3-8-database_dialect-postgresql/lib/python3.8/site-packages/grpc/_channel.py:1161: in call
return _end_unary_response_blocking(state, call, False, None)


state = <grpc._channel._RPCState object at 0x7fb6a00a4940>
call = <grpc._cython.cygrpc.SegregatedCall object at 0x7fb6a00a5340>
with_call = False, deadline = None

def _end_unary_response_blocking(
    state: _RPCState,
    call: cygrpc.SegregatedCall,
    with_call: bool,
    deadline: Optional[float],
) -> Union[ResponseType, Tuple[ResponseType, grpc.Call]]:
    if state.code is grpc.StatusCode.OK:
        if with_call:
            rendezvous = _MultiThreadedRendezvous(state, call, None, deadline)
            return state.response, rendezvous
        else:
            return state.response
    else:
      raise _InactiveRpcError(state)  # pytype: disable=not-instantiable

E grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
E status = StatusCode.ABORTED
E details = "Transaction was aborted."
E debug_error_string = "UNKNOWN:Error received from peer ipv4:74.125.197.95:443 {created_time:"2023-09-30T09:44:55.515089221+00:00", grpc_status:10, grpc_message:"Transaction was aborted."}"
E >

.nox/system-3-8-database_dialect-postgresql/lib/python3.8/site-packages/grpc/_channel.py:1004: _InactiveRpcError

The above exception was the direct cause of the following exception:

sessions_database = <google.cloud.spanner_v1.database.Database object at 0x7fb6a0104970>
sessions_to_delete = [<google.cloud.spanner_v1.session.Session object at 0x7fb6a00a2400>]
database_dialect = <DatabaseDialect.POSTGRESQL: 2>

@_helpers.retry_mabye_conflict
@pytest.mark.skipif(
    _helpers.USE_EMULATOR, reason="Emulator does not support DML Returning."
)
def test_transaction_execute_update_dml_returning(
    sessions_database, sessions_to_delete, database_dialect
):
    sd = _sample_data

    session = sessions_database.session()
    session.create()
    sessions_to_delete.append(session)

    with session.batch() as batch:
        batch.delete(sd.TABLE, sd.ALL)

    with session.transaction() as transaction:
        for row in sd.ROW_DATA:
            insert_statement = _generate_insert_returning_statement(
                row, database_dialect
            )
          row_count = transaction.execute_update(insert_statement)

tests/system/test_session_api.py:838:


google/cloud/spanner_v1/transaction.py:399: in execute_update
response = self._execute_request(
google/cloud/spanner_v1/transaction.py:109: in _execute_request
response = _retry(
google/cloud/spanner_v1/_helpers.py:334: in _retry
raise exc
google/cloud/spanner_v1/_helpers.py:320: in _retry
return func()
google/cloud/spanner_v1/services/spanner/client.py:1114: in execute_sql
response = rpc(
.nox/system-3-8-database_dialect-postgresql/lib/python3.8/site-packages/google/api_core/gapic_v1/method.py:131: in call
return wrapped_func(*args, **kwargs)
.nox/system-3-8-database_dialect-postgresql/lib/python3.8/site-packages/google/api_core/retry.py:366: in retry_wrapped_func
return retry_target(
.nox/system-3-8-database_dialect-postgresql/lib/python3.8/site-packages/google/api_core/retry.py:204: in retry_target
return target()
.nox/system-3-8-database_dialect-postgresql/lib/python3.8/site-packages/google/api_core/timeout.py:120: in func_with_timeout
return func(*args, **kwargs)


args = (session: "projects/precise-truck-742/instances/google-cloud-1696066739495/databases/test_sessions_1696067049334/sessi..., 'wylma@example.com') RETURNING contact_id, first_name, last_name, email"
params {
}
seqno: 2
request_options {
}
,)
kwargs = {'metadata': [('google-cloud-resource-prefix', 'projects/precise-truck-742/instances/google-cloud-1696066739495/databa...TzWm7y9JBFrdQN9IGMYg'), ('x-goog-api-client', 'gl-python/3.8.13 grpc/1.59.0 gax/2.12.0 gccl/3.40.1')], 'timeout': 30.0}

@functools.wraps(callable_)
def error_remapped_callable(*args, **kwargs):
    try:
        return callable_(*args, **kwargs)
    except grpc.RpcError as exc:
      raise exceptions.from_grpc_error(exc) from exc

E google.api_core.exceptions.Aborted: 409 Transaction was aborted.

.nox/system-3-8-database_dialect-postgresql/lib/python3.8/site-packages/google/api_core/grpc_helpers.py:77: Aborted

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner API.flakybot: flakyTells the Flaky Bot not to close or comment on this issue.flakybot: issueAn issue filed by the Flaky Bot. Should not be added manually.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions