opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Version 0.23b0 not setting status codes correctly

Open larkee opened this issue 5 years ago • 5 comments

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).

larkee avatar Jul 27 '21 01:07 larkee

Sorry, how is this error related to this project? Where does the tests/_helpers.py file exists?

ocelotl avatar Aug 03 '21 20:08 ocelotl

@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?

owais avatar Aug 18 '21 13:08 owais

I suggest closing this issue and reopening when more information is available. Thoughts, @owais, @lzchen ?

ocelotl avatar Aug 26 '21 20:08 ocelotl

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.

owais avatar Aug 26 '21 20:08 owais

Closing this. Feel free to re-open @larkee if you feel differently.

lzchen avatar Aug 27 '21 17:08 lzchen