Skip to content

Commit

Permalink
test: fix failing backup system tests (#2)
Browse files Browse the repository at this point in the history
* Remove unnecessary retention period setting

* Fix systests
  • Loading branch information
zoercai committed Jan 27, 2021
1 parent e007c5d commit b05ae59
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions tests/system/test_system.py
Expand Up @@ -598,22 +598,6 @@ def setUpClass(cls):
op1.result(30) # raises on failure / timeout.
op2.result(30) # raises on failure / timeout.

# Add retention period for backups
retention_period = "7d"
ddl_statements = DDL_STATEMENTS + [
"ALTER DATABASE {}"
" SET OPTIONS (version_retention_period = '{}')".format(
cls.DATABASE_NAME, retention_period
)
]
db = Config.INSTANCE.database(
cls.DATABASE_NAME, pool=pool, ddl_statements=ddl_statements
)
operation = db.update_ddl(ddl_statements)
# We want to make sure the operation completes.
operation.result(240) # raises on failure / timeout.
db.reload()

current_config = Config.INSTANCE.configuration_name
same_config_instance_id = "same-config" + unique_resource_id("-")
create_time = str(int(time.time()))
Expand Down Expand Up @@ -725,7 +709,11 @@ def test_backup_workflow(self):
database = instance.database(restored_id)
self.to_drop.append(database)
operation = database.restore(source=backup)
operation.result()
restored_db = operation.result()
self.assertEqual(version_time, restored_db.restore_info.backup_info.create_time)

metadata = operation.metadata
self.assertEqual(version_time, metadata.backup_info.create_time)

database.drop()
backup.delete()
Expand Down

0 comments on commit b05ae59

Please sign in to comment.