Yes, it would indeed hang forever if remove does not work, I'll have to come up with something that still allows a freestanding function without potentially hanging.

We test if the remove succeeded further down in the test this is just a function to reuse the logic for cleanup.