mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: reduce default timeout to 10s (#9906)
This commit is contained in:
parent
48e7bdd75e
commit
de86cafe3c
@ -20,8 +20,8 @@ module.exports = {
|
|||||||
require: ['./test/build/mocha-utils.js', 'source-map-support/register'],
|
require: ['./test/build/mocha-utils.js', 'source-map-support/register'],
|
||||||
spec: 'test/build/**/*.spec.js',
|
spec: 'test/build/**/*.spec.js',
|
||||||
exit: !!process.env.CI,
|
exit: !!process.env.CI,
|
||||||
retries: 0,
|
retries: process.env.CI ? 3 : 0,
|
||||||
parallel: !!process.env.PARALLEL,
|
parallel: !!process.env.PARALLEL,
|
||||||
timeout: 25_000,
|
timeout: 10_000,
|
||||||
reporter: process.env.CI ? 'spec' : 'dot',
|
reporter: process.env.CI ? 'spec' : 'dot',
|
||||||
};
|
};
|
||||||
|
@ -22,6 +22,7 @@ import {
|
|||||||
PageEmittedEvents,
|
PageEmittedEvents,
|
||||||
WaitForOptions,
|
WaitForOptions,
|
||||||
} from '../../api/Page.js';
|
} from '../../api/Page.js';
|
||||||
|
import {isErrorLike} from '../../util/ErrorLike.js';
|
||||||
import {ConsoleMessage, ConsoleMessageLocation} from '../ConsoleMessage.js';
|
import {ConsoleMessage, ConsoleMessageLocation} from '../ConsoleMessage.js';
|
||||||
import {Handler} from '../EventEmitter.js';
|
import {Handler} from '../EventEmitter.js';
|
||||||
import {EvaluateFunc, HandleFor} from '../types.js';
|
import {EvaluateFunc, HandleFor} from '../types.js';
|
||||||
@ -45,11 +46,17 @@ export class Page extends PageBase {
|
|||||||
super();
|
super();
|
||||||
this.#context = context;
|
this.#context = context;
|
||||||
|
|
||||||
this.#context.connection.send('session.subscribe', {
|
this.#context.connection
|
||||||
|
.send('session.subscribe', {
|
||||||
events: [
|
events: [
|
||||||
...this.#subscribedEvents.keys(),
|
...this.#subscribedEvents.keys(),
|
||||||
] as Bidi.Session.SubscribeParameters['events'],
|
] as Bidi.Session.SubscribeParameters['events'],
|
||||||
contexts: [this.#context.id],
|
contexts: [this.#context.id],
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (isErrorLike(error) && !error.message.includes('Target closed')) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const [event, subscriber] of this.#subscribedEvents) {
|
for (const [event, subscriber] of this.#subscribedEvents) {
|
||||||
|
@ -107,6 +107,12 @@
|
|||||||
"parameters": ["cdp", "firefox"],
|
"parameters": ["cdp", "firefox"],
|
||||||
"expectations": ["SKIP"]
|
"expectations": ["SKIP"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[emulation.spec] Emulation Page.viewport should detect touch when applying viewport with touches",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["firefox"],
|
||||||
|
"expectations": ["FAIL", "PASS", "TIMEOUT"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[evaluation.spec] Evaluation specs Frame.evaluate should execute after cross-site navigation",
|
"testIdPattern": "[evaluation.spec] Evaluation specs Frame.evaluate should execute after cross-site navigation",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
@ -801,7 +807,7 @@
|
|||||||
"testIdPattern": "[jshandle.spec] JSHandle JSHandle.asElement should return ElementHandle for TextNodes",
|
"testIdPattern": "[jshandle.spec] JSHandle JSHandle.asElement should return ElementHandle for TextNodes",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
"parameters": ["firefox", "webDriverBiDi"],
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
"expectations": ["FAIL", "TIMEOUT"]
|
"expectations": ["FAIL", "PASS", "TIMEOUT"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[jshandle.spec] JSHandle JSHandle.jsonValue should not work with dates",
|
"testIdPattern": "[jshandle.spec] JSHandle JSHandle.jsonValue should not work with dates",
|
||||||
|
@ -197,7 +197,9 @@ describe('AriaQueryHandler', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('queryAllArray', () => {
|
describe('queryAllArray', () => {
|
||||||
it('$$eval should handle many elements', async () => {
|
it('$$eval should handle many elements', async function () {
|
||||||
|
this.timeout(25_000);
|
||||||
|
|
||||||
const {page} = getTestState();
|
const {page} = getTestState();
|
||||||
await page.setContent('');
|
await page.setContent('');
|
||||||
await page.evaluate(
|
await page.evaluate(
|
||||||
|
@ -474,6 +474,7 @@ describe('Evaluation specs', function () {
|
|||||||
expect(result).toEqual([42]);
|
expect(result).toEqual([42]);
|
||||||
});
|
});
|
||||||
it('should transfer 100Mb of data from page to node.js', async function () {
|
it('should transfer 100Mb of data from page to node.js', async function () {
|
||||||
|
this.timeout(25_000);
|
||||||
const {page} = getTestState();
|
const {page} = getTestState();
|
||||||
|
|
||||||
const a = await page.evaluate(() => {
|
const a = await page.evaluate(() => {
|
||||||
|
@ -129,7 +129,9 @@ describe('querySelector', function () {
|
|||||||
);
|
);
|
||||||
expect(sum).toBe(8);
|
expect(sum).toBe(8);
|
||||||
});
|
});
|
||||||
it('should handle many elements', async () => {
|
it('should handle many elements', async function () {
|
||||||
|
this.timeout(25_000);
|
||||||
|
|
||||||
const {page} = getTestState();
|
const {page} = getTestState();
|
||||||
await page.evaluate(
|
await page.evaluate(
|
||||||
`
|
`
|
||||||
@ -479,7 +481,9 @@ describe('querySelector', function () {
|
|||||||
);
|
);
|
||||||
expect(sum).toBe(8);
|
expect(sum).toBe(8);
|
||||||
});
|
});
|
||||||
it('$$eval should handle many elements', async () => {
|
it('$$eval should handle many elements', async function () {
|
||||||
|
this.timeout(25_000);
|
||||||
|
|
||||||
const {page} = getTestState();
|
const {page} = getTestState();
|
||||||
await page.evaluate(
|
await page.evaluate(
|
||||||
`
|
`
|
||||||
|
Loading…
Reference in New Issue
Block a user