From 08ea36caa2b79ca74e3aade3798d7863840ed785 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 27 Feb 2025 16:31:32 +0000 Subject: [PATCH] chore: default reportSlowTests to 5 minutes (#34950) --- docs/src/test-api/class-fullconfig.md | 4 ++-- docs/src/test-api/class-testconfig.md | 2 +- packages/playwright/src/common/config.ts | 2 +- packages/playwright/src/isomorphic/teleReceiver.ts | 2 +- packages/playwright/types/test.d.ts | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/test-api/class-fullconfig.md b/docs/src/test-api/class-fullconfig.md index 923c9fa858..edbc991bfd 100644 --- a/docs/src/test-api/class-fullconfig.md +++ b/docs/src/test-api/class-fullconfig.md @@ -93,8 +93,8 @@ See [`property: TestConfig.reporter`]. ## property: FullConfig.reportSlowTests * since: v1.10 - type: <[null]|[Object]> - - `max` <[int]> The maximum number of slow test files to report. Defaults to `5`. - - `threshold` <[float]> Test duration in milliseconds that is considered slow. Defaults to 15 seconds. + - `max` <[int]> The maximum number of slow test files to report. + - `threshold` <[float]> Test file duration in milliseconds that is considered slow. See [`property: TestConfig.reportSlowTests`]. diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md index 213928e2e7..f837ddbfe8 100644 --- a/docs/src/test-api/class-testconfig.md +++ b/docs/src/test-api/class-testconfig.md @@ -429,7 +429,7 @@ export default defineConfig({ * since: v1.10 - type: ?<[null]|[Object]> - `max` <[int]> The maximum number of slow test files to report. Defaults to `5`. - - `threshold` <[float]> Test duration in milliseconds that is considered slow. Defaults to 15 seconds. + - `threshold` <[float]> Test file duration in milliseconds that is considered slow. Defaults to 5 minutes. Whether to report slow test files. Pass `null` to disable this feature. diff --git a/packages/playwright/src/common/config.ts b/packages/playwright/src/common/config.ts index 4ebc900872..8d213226ff 100644 --- a/packages/playwright/src/common/config.ts +++ b/packages/playwright/src/common/config.ts @@ -99,7 +99,7 @@ export class FullConfigInternal { metadata: userConfig.metadata, preserveOutput: takeFirst(userConfig.preserveOutput, 'always'), reporter: takeFirst(configCLIOverrides.reporter, resolveReporters(userConfig.reporter, configDir), [[defaultReporter]]), - reportSlowTests: takeFirst(userConfig.reportSlowTests, { max: 5, threshold: 15000 }), + reportSlowTests: takeFirst(userConfig.reportSlowTests, { max: 5, threshold: 300_000 /* 5 minutes */ }), quiet: takeFirst(configCLIOverrides.quiet, userConfig.quiet, false), projects: [], shard: takeFirst(configCLIOverrides.shard, userConfig.shard, null), diff --git a/packages/playwright/src/isomorphic/teleReceiver.ts b/packages/playwright/src/isomorphic/teleReceiver.ts index b9aa5edba9..29b1beb74d 100644 --- a/packages/playwright/src/isomorphic/teleReceiver.ts +++ b/packages/playwright/src/isomorphic/teleReceiver.ts @@ -605,7 +605,7 @@ export const baseFullConfig: reporterTypes.FullConfig = { preserveOutput: 'always', projects: [], reporter: [[process.env.CI ? 'dot' : 'list']], - reportSlowTests: { max: 5, threshold: 15000 }, + reportSlowTests: { max: 5, threshold: 300_000 /* 5 minutes */ }, configFile: '', rootDir: '', quiet: false, diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 1e9fef6b6c..4cc816993a 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -1443,7 +1443,7 @@ interface TestConfig { max: number; /** - * Test duration in milliseconds that is considered slow. Defaults to 15 seconds. + * Test file duration in milliseconds that is considered slow. Defaults to 5 minutes. */ threshold: number; }; @@ -1895,12 +1895,12 @@ export interface FullConfig { */ reportSlowTests: null|{ /** - * The maximum number of slow test files to report. Defaults to `5`. + * The maximum number of slow test files to report. */ max: number; /** - * Test duration in milliseconds that is considered slow. Defaults to 15 seconds. + * Test file duration in milliseconds that is considered slow. */ threshold: number; };