updating test to close socket with timeout