add test for opening and closing in quick succession

there might be a better way to do this test, setting timeouts like this seems pretty dirty. Let me know if you have suggestions.