Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

Intermittent SocketExceptions when running tests on Mac OS X #45

Description

@matthewbalvanz-wf

I am working with dart-sync-webdriver on Mac OS X and am encountering issues that raise a SocketException intermittently during the tests. I took the following steps to setup my environment:

git clone https://github.com/google/dart-sync-webdriver.git
cd dart-sync-webdriver
pub get
./packages/sync_socket/../tool/build.sh
dart test/webdriver_test.dart

I started the Selenium server before calling the tests with the command:

java -jar ~/selenium-server-standalone-2.45.0.jar -Dwebdriver.chrome.driver=/Users/matthewbalvanz/bin/chromedriver

The environment appears to generally work as the browser is opening and the tests are interacting with the test page but approximately half of the tests then fail with a message like the following:

ERROR: Window size
  Test failed: Caught SocketException: Unable to connect to host
  package:sync_socket/src/socket.dart 18:59          _connect
  package:sync_socket/src/socket.dart 36:23          SocketSync.SocketSync
  package:sync_socket/src/http_client.dart 69:28     HttpClientRequestSync.HttpClientRequestSync._
  package:sync_socket/src/http_client.dart 27:11     HttpClientSync.getUrl
  package:sync_webdriver/src/web_driver.dart 240:35  WebDriver._get
  package:sync_webdriver/src/web_driver.dart 131:47  WebDriver.window
  test/src/window_test.dart 39:14                    main.<fn>.<fn>
  dart:isolate                                       _RawReceivePortImpl._handleMessage

When I perform the same steps in an Ubuntu environment I do not receive any SocketExceptions in the tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions