Skip to content

Commit

Permalink
Harden spanner system tests further. (#4374)
Browse files Browse the repository at this point in the history
Because of quota, we are sharing the instance we use to test CRUD of
databases: we therefore cannot rely on having only the expected databases
present, as other tests may be running simultaneously, or may have failed
in ways which left 'stray' databases in the instance.
  • Loading branch information
tseaver authored Nov 9, 2017
1 parent 3f3fbe4 commit 16b3638
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spanner/tests/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,10 @@ def test_create_database(self):
# We want to make sure the operation completes.
operation.result(30) # raises on failure / timeout.

name_attr = operator.attrgetter('name')
expected = sorted([temp_db, self._db], key=name_attr)

databases = list(Config.INSTANCE.list_databases())
found = sorted(databases, key=name_attr)
self.assertEqual(found, expected)
database_ids = [
database.database_id
for database in Config.INSTANCE.list_databases()]
self.assertIn(temp_db_id, database_ids)

def test_update_database_ddl(self):
pool = BurstyPool()
Expand Down

0 comments on commit 16b3638

Please sign in to comment.