Version 0.23b0 not setting status codes correctly
16 unit tests in python-spanner are suddenly failing with the following errors:
tests/_helpers.py:72: in assertSpanAttributes
self.assertEqual(span.status.status_code, status)
E AssertionError: <StatusCode.OK: 1> != <StatusCode.ERROR: 2>
See here for more info.
These errors are resolved by pinning to the previous version (0.22b0).
Sorry, how is this error related to this project? Where does the tests/_helpers.py file exists?
@larkee if you think this is a bug in Otel, can you please provide a code snippet that exhibits the problem or steps to reproduce this with Otel libraries directly?
I suggest closing this issue and reopening when more information is available. Thoughts, @owais, @lzchen ?
self = <tests.unit.test_transaction.TestTransaction testMethod=test_rollback_w_other_error>
def test_rollback_w_other_error(self):
database = _Database()
database.spanner_api = self._make_spanner_api()
database.spanner_api.rollback.side_effect = RuntimeError("other error")
session = _Session(database)
transaction = self._make_one(session)
transaction._transaction_id = self.TRANSACTION_ID
transaction.insert(TABLE_NAME, COLUMNS, VALUES)
with self.assertRaises(RuntimeError):
transaction.rollback()
self.assertFalse(transaction.rolled_back)
> self.assertSpanAttributes(
"CloudSpanner.Rollback",
status=StatusCode.ERROR,
attributes=TestTransaction.BASE_ATTRIBUTES,
)
At least at surface this looks an issue in the system using Otel, not otel itself so I'm fine with closing this.
Closing this. Feel free to re-open @larkee if you feel differently.