Unverified Commit 41eaa532 authored by Rajashree Mandaogane's avatar Rajashree Mandaogane Committed by GitHub
Browse files

Merge pull request #26432 from mrajashree/flakytests

Fix flaky tests
Showing with 9 additions and 3 deletions
+9 -3
......@@ -175,19 +175,22 @@ def test_cluster_catalog_templates_access(admin_mc, user_factory,
# Now remove user1 also from the cluster, this should mean user1 should
# no longer be able to access the catalog and templates
admin_client.delete(crtb_member)
wait_for_clustercatalog_template_to_be_deleted(user1.client, catalog_name)
wait_for_clustercatalog_template_to_be_deleted(user1.client, catalog_name,
120)
# Now remove the user admin_pc from the project of this cluster,
# so admin_pc should no longer have access to catalog and templates
admin_client.delete(prtb_owner)
wait_for_clustercatalog_template_to_be_deleted(user2.client, catalog_name)
wait_for_clustercatalog_template_to_be_deleted(user2.client, catalog_name,
120)
templateversions = \
user2.client.list_template(clusterCatalogId=catalog_name)
assert len(templateversions) == 0
admin_client.delete(cc)
wait_for_clustercatalog_template_to_be_deleted(admin_client, catalog_name)
wait_for_clustercatalog_template_to_be_deleted(admin_client, catalog_name,
120)
def wait_for_clustercatalog_template_to_be_created(client, name, timeout=45):
......
......@@ -152,6 +152,9 @@ def test_project_create_role_locked(admin_mc, cleanup_roles, remove_resource):
# Lock the role
client.update(client.by_id_role_template(locked_role), locked=True)
# Wait for role to get updated
wait_for(lambda: client.by_id_role_template(locked_role)['locked'] is True,
fail_handler=lambda: "Failed to lock role"+locked_role)
project = client.create_project(name=random_str(), clusterId='local')
remove_resource(project)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment