-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add systests for read/query w/ concurrent updates. #3632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add systests for read/query w/ concurrent updates. #3632
Conversation
dhermes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending green CI (should you push a branch to the GCP remote so we can see the system tests?)
spanner/tests/system/test_system.py
Outdated
| self._check_row_data(rows) | ||
|
|
||
| def _transaction_concurrency_helper(self, unit_of_work, pkey): | ||
| import threading |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| [[pkey, INITIAL_VALUE]]) | ||
|
|
||
| # We don't want to run the threads' transactions in the current | ||
| # session, which would fail. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/tests/system/test_system.py
Outdated
| self.assertEqual(len(rows), 1) | ||
| pkey, value = rows[0] | ||
| transaction.update( | ||
| self.COUNTERS_TABLE, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Test failures look unrelated to our code :< |
|
@tseaver I'm working on it, it's a problem in our base image. |
spanner/tests/system/test_system.py
Outdated
| retry = RetryInstanceState(_has_all_ddl) | ||
| retry(self._db.reload)() | ||
|
|
||
| class TestException(Exception): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| with session.batch() as batch: | ||
| batch.delete(self.TABLE, self.ALL) | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Base image fixed, any test failures are no longer my fault. :) |
spanner/tests/system/test_system.py
Outdated
| rows = list(transaction.read(self.TABLE, self.COLUMNS, self.ALL)) | ||
| self.assertEqual(len(rows), 0) | ||
| transaction.insert(self.TABLE, self.COLUMNS, self.ROW_DATA) | ||
| raise TestException() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@tseaver I presume https://circleci.com/gh/GoogleCloudPlatform/google-cloud-python/2453 is the build in the GCP remote? |
|
@tseaver Rename your custom exception? |
|
Ugh, failures are now due to BQ system test flakiness, Why are we running tests for the other APIs again? |
Because no on (you or I included) has written tooling to make the build aware of what it should be building. The relevant code is here https://github.com/GoogleCloudPlatform/google-cloud-python/blob/3d9461b91963fcc6e6a864f6f0eacad3d92bbf2d/test_utils/scripts/get_target_packages.py but IMO it's not worth it since we're breaking up the monorepo soon. |
|
Breaking up the monorepo doesn't seem to be high up on anybody's priority list ATM. |
* Also add systest for user exception aborting transaction.
* Also add systest for user exception aborting transaction.
* Also add systest for user exception aborting transaction.
No description provided.