Refactored the timeout tests.