Title: Deflake OpenTelemetry assertion in system tests · Issue #165 · googleapis/python-spanner · GitHub
Open Graph Title: Deflake OpenTelemetry assertion in system tests · Issue #165 · googleapis/python-spanner
X Title: Deflake OpenTelemetry assertion in system tests · Issue #165 · googleapis/python-spanner
Description: The OpenTelemetry assertions in the system tests fail if the transaction is aborted and retried. This is extremely brittle so the assertions need to be updated to account for retrying aborted transactions. Example of test failure: ______...
Open Graph Description: The OpenTelemetry assertions in the system tests fail if the transaction is aborted and retried. This is extremely brittle so the assertions need to be updated to account for retrying aborted trans...
X Description: The OpenTelemetry assertions in the system tests fail if the transaction is aborted and retried. This is extremely brittle so the assertions need to be updated to account for retrying aborted trans...
Opengraph URL: https://github.com/googleapis/python-spanner/issues/165
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Deflake OpenTelemetry assertion in system tests","articleBody":"The OpenTelemetry assertions in the system tests fail if the transaction is aborted and retried. This is extremely brittle so the assertions need to be updated to account for retrying aborted transactions.\r\n\r\nExample of test failure:\r\n```\r\n________ TestSessionAPI.test_transaction_read_and_insert_then_rollback _________\r\n\r\nself = \u003ctests.system.test_system.TestSessionAPI testMethod=test_transaction_read_and_insert_then_rollback\u003e\r\n\r\n @RetryErrors(exception=exceptions.ServerError)\r\n @RetryErrors(exception=exceptions.Aborted)\r\n def test_transaction_read_and_insert_then_rollback(self):\r\n retry = RetryInstanceState(_has_all_ddl)\r\n retry(self._db.reload)()\r\n\r\n session = self._db.session()\r\n session.create()\r\n self.to_delete.append(session)\r\n\r\n with self._db.batch() as batch:\r\n batch.delete(self.TABLE, self.ALL)\r\n\r\n transaction = session.transaction()\r\n transaction.begin()\r\n\r\n rows = list(transaction.read(self.TABLE, self.COLUMNS, self.ALL))\r\n self.assertEqual(rows, [])\r\n\r\n transaction.insert(self.TABLE, self.COLUMNS, self.ROW_DATA)\r\n\r\n # Inserted rows can't be read until after commit.\r\n rows = list(transaction.read(self.TABLE, self.COLUMNS, self.ALL))\r\n self.assertEqual(rows, [])\r\n transaction.rollback()\r\n\r\n rows = list(session.read(self.TABLE, self.COLUMNS, self.ALL))\r\n self.assertEqual(rows, [])\r\n\r\n if HAS_OPENTELEMETRY_INSTALLED:\r\n span_list = self.memory_exporter.get_finished_spans()\r\n\u003e self.assertEqual(len(span_list), 8)\r\nE AssertionError: 14 != 8\r\n\r\ntests/system/test_system.py:1026: AssertionError\r\n----------------------------- Captured stdout call -----------------------------\r\n409 Transaction was aborted., Trying again in 1 seconds...\r\n------------------------------ Captured log call -------------------------------\r\nWARNING opentelemetry.trace:__init__.py:468 Overriding current TracerProvider\r\nWARNING opentelemetry.trace:__init__.py:468 Overriding current TracerProvider\r\n```","author":{"url":"https://github.com/larkee","@type":"Person","name":"larkee"},"datePublished":"2020-11-11T01:37:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/165/python-spanner/issues/165"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5b979968-a60b-833c-f146-4dfa24433c07 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E180:1EE1:374EF93:4E9F9E2:6A4FB5A7 |
| html-safe-nonce | 081030aca48c74628bac15e1f214169d5e2801c88ec4463d015094f489ab2406 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTgwOjFFRTE6Mzc0RUY5Mzo0RTlGOUUyOjZBNEZCNUE3IiwidmlzaXRvcl9pZCI6IjM5MDU4NTM1MjU3Mzc4NDYxODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e35230044bf3bf6a92845e9587dbef76509b56850e6c2c279d23e743edb5defb |
| hovercard-subject-tag | issue:740379424 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-spanner/165/issue_layout |
| twitter:image | https://opengraph.githubassets.com/78d948dcc6a089df52ad49edfad31c25ed669810cb0eb1b776b9615e01dc4f70/googleapis/python-spanner/issues/165 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/78d948dcc6a089df52ad49edfad31c25ed669810cb0eb1b776b9615e01dc4f70/googleapis/python-spanner/issues/165 |
| og:image:alt | The OpenTelemetry assertions in the system tests fail if the transaction is aborted and retried. This is extremely brittle so the assertions need to be updated to account for retrying aborted trans... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | larkee |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-spanner git https://github.com/googleapis/python-spanner.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992630 |
| octolytics-dimension-repository_nwo | googleapis/python-spanner |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992630 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-spanner |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width