@@ -287,25 +287,25 @@ 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.
299297 time .sleep (60 )
300298
301299 db_instance .wait_until_deleted (db_instance_id )
300+ # ensure db_instance is removed from k8s once it is removed from AWS
301+ assert not k8s .get_resource_exists (db_instance_ref )
302+
302303
303304 # Same for the DB cluster because it refers to the DB cluster
304305 # parameter group...
305- _ , deleted = k8s .delete_custom_resource (
306- db_cluster_ref ,
307- period_length = DELETE_CLUSTER_TIMEOUT_SECONDS ,
308- )
309- assert deleted
306+ k8s .delete_custom_resource (db_cluster_ref )
307+ assert k8s .get_resource_exists (db_cluster_ref )
310308
309+ time .sleep (60 )
311310 db_cluster .wait_until_deleted (db_cluster_id )
311+ assert not k8s .get_resource_exists (db_cluster_ref )
0 commit comments