The test assumes that a timeout exception will result when connecting to the IP 8.8.8.7 and does not inspect the exception details.
Instead, the test could use a C helper program (or Dart FFI) that binds to a socket but does not accept connections to simulate connection timeout.