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'],
|
||||
spec: 'test/build/**/*.spec.js',
|
||||
exit: !!process.env.CI,
|
||||
retries: 0,
|
||||
retries: process.env.CI ? 3 : 0,
|
||||
parallel: !!process.env.PARALLEL,
|
||||
timeout: 25_000,
|
||||
timeout: 10_000,
|
||||
reporter: process.env.CI ? 'spec' : 'dot',
|
||||
};
|
||||
|
@ -22,6 +22,7 @@ import {
|
||||
PageEmittedEvents,
|
||||
WaitForOptions,
|
||||
} from '../../api/Page.js';
|
||||
import {isErrorLike} from '../../util/ErrorLike.js';
|
||||
import {ConsoleMessage, ConsoleMessageLocation} from '../ConsoleMessage.js';
|
||||
import {Handler} from '../EventEmitter.js';
|
||||
import {EvaluateFunc, HandleFor} from '../types.js';
|
||||
@ -45,12 +46,18 @@ export class Page extends PageBase {
|
||||
super();
|
||||
this.#context = context;
|
||||
|
||||
this.#context.connection.send('session.subscribe', {
|
||||
events: [
|
||||
...this.#subscribedEvents.keys(),
|
||||
] as Bidi.Session.SubscribeParameters['events'],
|
||||
contexts: [this.#context.id],
|
||||
});
|
||||
this.#context.connection
|
||||
.send('session.subscribe', {
|
||||
events: [
|
||||
...this.#subscribedEvents.keys(),
|
||||
] as Bidi.Session.SubscribeParameters['events'],
|
||||
contexts: [this.#context.id],
|
||||
})
|
||||
.catch(error => {
|
||||
if (isErrorLike(error) && !error.message.includes('Target closed')) {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
for (const [event, subscriber] of this.#subscribedEvents) {
|
||||
this.#context.on(event, subscriber);
|
||||
|
@ -107,6 +107,12 @@
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"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",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
@ -801,7 +807,7 @@
|
||||
"testIdPattern": "[jshandle.spec] JSHandle JSHandle.asElement should return ElementHandle for TextNodes",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["firefox", "webDriverBiDi"],
|
||||
"expectations": ["FAIL", "TIMEOUT"]
|
||||
"expectations": ["FAIL", "PASS", "TIMEOUT"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[jshandle.spec] JSHandle JSHandle.jsonValue should not work with dates",
|
||||
|
@ -197,7 +197,9 @@ describe('AriaQueryHandler', () => {
|
||||
});
|
||||
});
|
||||
describe('queryAllArray', () => {
|
||||
it('$$eval should handle many elements', async () => {
|
||||
it('$$eval should handle many elements', async function () {
|
||||
this.timeout(25_000);
|
||||
|
||||
const {page} = getTestState();
|
||||
await page.setContent('');
|
||||
await page.evaluate(
|
||||
|
@ -474,6 +474,7 @@ describe('Evaluation specs', function () {
|
||||
expect(result).toEqual([42]);
|
||||
});
|
||||
it('should transfer 100Mb of data from page to node.js', async function () {
|
||||
this.timeout(25_000);
|
||||
const {page} = getTestState();
|
||||
|
||||
const a = await page.evaluate(() => {
|
||||
|
@ -129,7 +129,9 @@ describe('querySelector', function () {
|
||||
);
|
||||
expect(sum).toBe(8);
|
||||
});
|
||||
it('should handle many elements', async () => {
|
||||
it('should handle many elements', async function () {
|
||||
this.timeout(25_000);
|
||||
|
||||
const {page} = getTestState();
|
||||
await page.evaluate(
|
||||
`
|
||||
@ -479,7 +481,9 @@ describe('querySelector', function () {
|
||||
);
|
||||
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();
|
||||
await page.evaluate(
|
||||
`
|
||||
|
Loading…
Reference in New Issue
Block a user