From 31d2a388812c0fa415ad71466225994b09afc116 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 30 Apr 2026 17:11:41 -0700 Subject: [PATCH] chore: reduce CI flakiness across webkit/macOS, ubuntu, windows Three independent fixes for recurring CI failures on main: - test.yml: run the webkit matrix on macos-15-xlarge instead of macos-latest. macos-latest is the free 3 vCPU / 7 GB M1 runner; the webkit suite has been crashing window.open() / popup tests on it every push run. Upstream's webkit matrix has always used xlarge (tests_secondary.yml). Other browsers stay on macos-latest. - TestRouteWebSocket: drop the 'error' event listener in setupWS. WebKit fires a spurious 'error' before 'close' on non-normal closures (e.g. 1008), which intermittently failed shouldWorkWithTextMessage with [open, message, error, close] vs the expected [open, message, close]. The Java port has no tests that assert on 'error'. - download_driver.sh: pass --retry 5 --retry-delay 2 -fL to curl, fixing the windows driver download that occasionally errors with 'curl: (56) schannel: server closed abruptly'. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/test.yml | 8 ++++++++ .../java/com/microsoft/playwright/TestRouteWebSocket.java | 2 +- scripts/download_driver.sh | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b79e83739..6a741e578 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,14 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] browser: [chromium, firefox, webkit] + exclude: + # macos-latest is the free M1 runner (3 vCPU / 7 GB); WebKit needs more headroom. + # Upstream's webkit matrix runs on macos-15-xlarge for the same reason. + - os: macos-latest + browser: webkit + include: + - os: macos-15-xlarge + browser: webkit runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 diff --git a/playwright/src/test/java/com/microsoft/playwright/TestRouteWebSocket.java b/playwright/src/test/java/com/microsoft/playwright/TestRouteWebSocket.java index 08af287d1..8811cdc64 100644 --- a/playwright/src/test/java/com/microsoft/playwright/TestRouteWebSocket.java +++ b/playwright/src/test/java/com/microsoft/playwright/TestRouteWebSocket.java @@ -45,13 +45,13 @@ private void setupWS(Page target, Server server, int port, String binaryType) { } private void setupWS(Frame target, Server server, int port, String binaryType) { target.navigate(server.EMPTY_PAGE); + // No 'error' listener: WebKit fires a spurious 'error' before 'close' on non-normal closures (e.g. 1008). target.evaluate("({ port, binaryType }) => {\n" + " window.log = [];\n" + " window.ws = new WebSocket('ws://localhost:' + port + '/ws');\n" + " window.ws.binaryType = binaryType;\n" + " window.ws.addEventListener('open', () => window.log.push('open'));\n" + " window.ws.addEventListener('close', event => window.log.push(`close code=${event.code} reason=${event.reason}`));\n" + - " window.ws.addEventListener('error', event => window.log.push(`error`));\n" + " window.ws.addEventListener('message', async event => {\n" + " let data;\n" + " if (typeof event.data === 'string')\n" + diff --git a/scripts/download_driver.sh b/scripts/download_driver.sh index 00da58785..eaa6aeebb 100755 --- a/scripts/download_driver.sh +++ b/scripts/download_driver.sh @@ -50,7 +50,7 @@ do if command -v wget &> /dev/null; then wget $URL else - curl -O $URL + curl --retry 5 --retry-delay 2 -fL -O $URL fi unzip $FILE_NAME -d . rm $FILE_NAME