| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -334,23 +334,12 @@ def test_table_backup( | |
| assert restored_table in tables | ||
| restored_table.delete() | ||
|
|
||
| # Testing `Backup.restore()` into a different instance: | ||
| # Setting up another instance... | ||
| alt_instance_id = f"gcp-alt-{unique_suffix}" | ||
| alt_cluster_id = f"{alt_instance_id}-cluster" | ||
| alt_instance = admin_client.instance(alt_instance_id, labels=instance_labels) | ||
| alt_cluster = alt_instance.cluster( | ||
| cluster_id=alt_cluster_id, | ||
| location_id=location_id, | ||
| serve_nodes=1, | ||
| # Testing `Backup.restore()`: | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitydid this change the behavior? it was testing restoring to a different instance before. Now it's just backing up to a different table? on the same instance?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYes, this is a slightly different test case now. Looking at the code, the client isn't really aware of whether the passed in is is new or old when building a request. So we're not really exercising any different client-side logic here, and it didn't feel worth consuming an extra Instance create/delete for this. But if you think this is important to cover, we can leave it as-is
Sorry, something went wrong.
All reactions
|
||
| restored_table_id_2 = "test-backup-table-restored-2" | ||
| restore_op = temp_backup.restore( | ||
| restored_table_id_2, data_instance_populated.instance_id | ||
| ) | ||
| create_op = alt_instance.create(clusters=[alt_cluster]) | ||
| instances_to_delete.append(alt_instance) | ||
| create_op.result(timeout=240) | ||
|
|
||
| # Testing `restore()`... | ||
| restore_op = temp_backup.restore(restored_table_id, alt_instance_id) | ||
| restore_op.result(timeout=240) | ||
| restored_table = alt_instance.table(restored_table_id) | ||
| assert restored_table in alt_instance.list_tables() | ||
| restored_table.delete() | ||
| restored_table_2 = data_instance_populated.table(restored_table_id_2) | ||
| assert restored_table_2 in data_instance_populated.list_tables() | ||
| restored_table_2.delete() | ||
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityAre instances cleaned up properly in the tests? Over time, would this cause instances to slowly increase on the test project? and eventually we could run into SSD node or HDD node quota and will need to clean up the test project manually
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityInstances are expected to clean themselves up in a post-test step when tests are finished. But there previously were (and maybe still are, and maybe will be in the future) resource leaks in certain cases, causing instances to build up slowly in the test project over time over time.
This function is trying to identify > day old test instances, and clear them, as an extra defense against this build-up. But ideally, it shouldn't be needed
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.