Skip to content

Commit aab886e

Browse files
authored
Merge branch 'master' into darrenbutts/PLA-1580/ignore-scripts-npmrc
2 parents e1e8734 + 9bc5d1f commit aab886e

4 files changed

Lines changed: 48 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ permissions:
1313
jobs:
1414
build:
1515
runs-on: ubuntu-22.04
16+
timeout-minutes: 20
17+
# `latest` is a floating, non-LTS target used as a forward-compat canary;
18+
# let it warn without blocking PRs or (with fail-fast off) cancelling the
19+
# supported legs.
20+
continue-on-error: ${{ matrix.node == 'latest' }}
1621

1722
strategy:
23+
fail-fast: false
1824
matrix:
1925
include:
2026
- node: 18
@@ -62,10 +68,22 @@ jobs:
6268
- name: Run server tests
6369
run: npm run test:server
6470

71+
# Browser tests launch chromium; the harness Node version is irrelevant to
72+
# browser coverage, so run them only on stable Node. The chromium download
73+
# in `playwright install` stalls indefinitely on Node 24/latest.
6574
- name: Install Playwright browsers
66-
run: npx playwright install chromium
75+
if: matrix.node != 24 && matrix.node != 'latest'
76+
# The chromium download can stall; cap each attempt and retry so a
77+
# transient stall doesn't hang the job until the timeout.
78+
run: |
79+
for i in 1 2 3; do
80+
timeout 300 npx playwright install chromium && exit 0
81+
echo "playwright install attempt $i stalled or failed; retrying"
82+
done
83+
exit 1
6784
6885
- name: Run browser tests (Web Test Runner)
86+
if: matrix.node != 24 && matrix.node != 'latest'
6987
run: npm run test:wtr
7088

7189
- name: Validate examples

package-lock.json

Lines changed: 17 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@
125125
"ts-node": "^10.9.2",
126126
"typescript": "^5.9.3",
127127
"typescript-eslint": "^8.46.4",
128-
"undici": "^6.23.0",
128+
"undici": "^7.27.2",
129+
"undici-v6": "npm:undici@^6.23.0",
129130
"webpack": "^5.98.0",
130131
"webpack-cli": "^6.0.1",
131132
"webpack-node-externals": "^3.0.0"

test/server.telemetry.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ import { URL } from 'url';
66
import { expect } from 'chai';
77
import nock from 'nock';
88
import sinon from 'sinon';
9-
import { MockAgent, getGlobalDispatcher, setGlobalDispatcher } from 'undici';
9+
// MockAgent only intercepts the built-in `fetch` when its global-dispatcher
10+
// symbol matches the running Node's bundled undici: undici 6 (symbol `.1`) for
11+
// Node 18-24, undici 7 (symbol `.2`) for the undici-7-bundled `latest` leg.
12+
// undici 7 also requires Node 20+ (it references the global `File`), so Node 18
13+
// must stay on undici 6 (the `undici-v6` alias). Dynamic import so only the
14+
// selected major is loaded (statically importing undici 7 on Node 18 would
15+
// crash at load time).
16+
const nodeMajor = parseInt(process.versions.node.split('.')[0], 10);
17+
const { MockAgent, getGlobalDispatcher, setGlobalDispatcher } =
18+
nodeMajor >= 20 ? await import('undici') : await import('undici-v6');
1019

1120
import Rollbar from '../src/server/rollbar.js';
1221
import { mergeOptions } from '../src/server/telemetry/urlHelpers.js';

0 commit comments

Comments
 (0)