removed useless assert and added test for graceful early shutdown