inprove runtime running tests
fix runtime shutdown detection