@@ -287,25 +287,24 @@ def test_references(
287287 # we try to delete the DB Parameter Group before the DB Instance, the
288288 # cascading delete protection of resource references will mean the DB
289289 # Parameter Group won't be deleted.
290- _ , deleted = k8s .delete_custom_resource (
291- db_instance_ref ,
292- period_length = DELETE_INSTANCE_TIMEOUT_SECONDS ,
293- )
294- assert deleted
290+ k8s .delete_custom_resource (db_instance_ref )
291+ # ensure db_instance does not disappear immidiately from k8s
292+ assert k8s .get_resource_exists (db_instance_ref )
295293
296294 # Wait a bit before trying to delete the cluster since the instance is
297295 # part of the cluster and sometimes the delete cluster complains if
298296 # it's too soon after deleting the last DB instance in it.
297+ db_instance .wait_until_deleted (db_instance_id )
299298 time .sleep (60 )
299+ # ensure db_instance is removed from k8s once it is removed from AWS
300+ assert not k8s .get_resource_exists (db_instance_ref )
300301
301- db_instance .wait_until_deleted (db_instance_id )
302302
303303 # Same for the DB cluster because it refers to the DB cluster
304304 # parameter group...
305- _ , deleted = k8s .delete_custom_resource (
306- db_cluster_ref ,
307- period_length = DELETE_CLUSTER_TIMEOUT_SECONDS ,
308- )
309- assert deleted
305+ k8s .delete_custom_resource (db_cluster_ref )
306+ assert k8s .get_resource_exists (db_cluster_ref )
310307
311308 db_cluster .wait_until_deleted (db_cluster_id )
309+ time .sleep (60 )
310+ assert not k8s .get_resource_exists (db_cluster_ref )
0 commit comments