Skip to content

Commit d0733a3

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/koa-2.16.1
2 parents 0663fd9 + 29f73c5 commit d0733a3

File tree

7 files changed

+41
-55
lines changed

7 files changed

+41
-55
lines changed

package-lock.json

-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/test-runner-chrome/CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# @web/test-runner-chrome
22

3+
## 0.18.1
4+
5+
### Patch Changes
6+
7+
- 79b0ba4: This changeset removes the Puppeteer/Chrome focus browser patches that shouldn't
8+
be needed anymore, and can cause instability.
9+
10+
The patches were added quite a while ago, and the upstream issues should
11+
be resolved in Chromium. See: https://issues.chromium.org/issues/40272146.
12+
13+
Also see:
14+
https://github.com/puppeteer/puppeteer/issues/10350#issuecomment-1586858101.
15+
16+
The patches are currently also resulting some instability of web test
17+
runner. That is because the patch calls an exposed function from inside
18+
the browser, while navigation later on during `stopSession` can happen;
19+
breaking the handle for retrieving function call arguments passed to the
20+
exposed function.
21+
22+
Puppeteer team found this issue and also landed a fix to improve the
23+
failure mode here. See:
24+
https://github.com/puppeteer/puppeteer/pull/13759
25+
326
## 0.18.0
427

528
### Minor Changes

packages/test-runner-chrome/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web/test-runner-chrome",
3-
"version": "0.18.0",
3+
"version": "0.18.1",
44
"publishConfig": {
55
"access": "public"
66
},
@@ -48,7 +48,6 @@
4848
"dependencies": {
4949
"@web/test-runner-core": "^0.13.0",
5050
"@web/test-runner-coverage-v8": "^0.8.0",
51-
"async-mutex": "0.4.0",
5251
"chrome-launcher": "^0.15.0",
5352
"puppeteer-core": "^24.0.0"
5453
},

packages/test-runner-chrome/src/ChromeLauncherPage.ts

-40
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import { Page, JSCoverageEntry } from 'puppeteer-core';
22
import { TestRunnerCoreConfig } from '@web/test-runner-core';
33
import { v8ToIstanbul } from '@web/test-runner-coverage-v8';
44
import { SessionResult } from '@web/test-runner-core';
5-
import { Mutex } from 'async-mutex';
6-
7-
const mutex = new Mutex();
85

96
declare global {
107
interface Window {
@@ -49,43 +46,6 @@ export class ChromeLauncherPage {
4946
});
5047
}
5148

52-
// Patching the browser page to workaround an issue in the new headless mode of Chrome where some functions
53-
// with callbacks (requestAnimationFrame and requestIdleCallback) are not executing their callbacks.
54-
// https://github.com/puppeteer/puppeteer/issues/10350
55-
if (!this.patchAdded) {
56-
await this.puppeteerPage.exposeFunction('__bringTabToFront', (id: string) => {
57-
const promise = new Promise(resolve => {
58-
this.resolvers[id] = resolve as () => void;
59-
});
60-
return mutex.runExclusive(async () => {
61-
await this.puppeteerPage.bringToFront();
62-
await promise;
63-
});
64-
});
65-
await this.puppeteerPage.exposeFunction('__releaseLock', (id: string) => {
66-
this.resolvers[id]?.();
67-
});
68-
await this.puppeteerPage.evaluateOnNewDocument(() => {
69-
// eslint-disable-next-line @typescript-eslint/ban-types
70-
function patchFunction(name: string, fn: Function) {
71-
(window as any)[name] = (...args: unknown[]) => {
72-
const result = fn.call(window, ...args);
73-
const id = Math.random().toString().substring(2);
74-
// Make sure that the tab running the test code is brought back to the front.
75-
window.__bringTabToFront(id);
76-
fn.call(window, () => {
77-
window.__releaseLock(id);
78-
});
79-
return result;
80-
};
81-
}
82-
83-
patchFunction('requestAnimationFrame', window.requestAnimationFrame);
84-
patchFunction('requestIdleCallback', window.requestIdleCallback);
85-
});
86-
this.patchAdded = true;
87-
}
88-
8949
await this.puppeteerPage.setViewport({ height: 600, width: 800 });
9050
await this.puppeteerPage.goto(url);
9151
}

packages/test-runner/CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# @web/test-runner
22

3+
## 0.20.1
4+
5+
### Patch Changes
6+
7+
- 24e3290: Improve debug message for test runner uncaught exceptions
8+
9+
This should make debugging easier. It wasn't very easy to figure out
10+
where the errors originated from (because of how the actual uncaught
11+
exception only happened with many concurrent builds inside a sandbox
12+
environment that is hard to debug).
13+
14+
- Updated dependencies [79b0ba4]
15+
- @web/test-runner-chrome@0.18.1
16+
317
## 0.20.0
418

519
### Minor Changes

packages/test-runner/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web/test-runner",
3-
"version": "0.20.0",
3+
"version": "0.20.1",
44
"publishConfig": {
55
"access": "public"
66
},
@@ -81,7 +81,7 @@
8181
"@web/browser-logs": "^0.4.0",
8282
"@web/config-loader": "^0.3.0",
8383
"@web/dev-server": "^0.4.0",
84-
"@web/test-runner-chrome": "^0.18.0",
84+
"@web/test-runner-chrome": "^0.18.1",
8585
"@web/test-runner-commands": "^0.9.0",
8686
"@web/test-runner-core": "^0.13.0",
8787
"@web/test-runner-mocha": "^0.9.0",

packages/test-runner/src/startTestRunner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export async function startTestRunner(options: StartTestRunnerParams = {}) {
7373
if (autoExitProcess) {
7474
process.on('uncaughtException', error => {
7575
/* eslint-disable-next-line no-console */
76-
console.error(error);
76+
console.error(`Uncaught exception, stopping test runner..\n`, error);
7777
stop();
7878
});
7979
}

0 commit comments

Comments
 (0)