Issue #15285: Refactor connect timeout test in test_timeout.