From 219fc99e99a0b0fdb285123f7b03cbcd901288cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 18 Aug 2025 08:57:52 -0700 Subject: [PATCH] Rename minDuration as minTestExecutionTime for clarity (#53321) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53321 Changelog: [internal] Just a rename to make it easier to understand. Reviewed By: rshest Differential Revision: D80404378 fbshipit-source-id: 3d7e89797be3b92599e07b4b64d2a720756a4f3b --- .../__tests__/Performance-benchmark-itest.js | 2 +- private/react-native-fantom/src/Benchmark.js | 12 ++++++------ .../BenchmarkTests-testMode-benchmark-itest.js | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js b/packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js index bf53c53fc11..d69768d8d71 100644 --- a/packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js +++ b/packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js @@ -22,7 +22,7 @@ const clearMarksAndMeasures = () => { }; Fantom.unstable_benchmark - .suite('Performance API', {minIterations: 50000, minDuration: 0}) + .suite('Performance API', {minIterations: 50000}) .test( 'mark (default)', () => { diff --git a/private/react-native-fantom/src/Benchmark.js b/private/react-native-fantom/src/Benchmark.js index 2871312ef1a..d1898b8ab1d 100644 --- a/private/react-native-fantom/src/Benchmark.js +++ b/private/react-native-fantom/src/Benchmark.js @@ -24,9 +24,9 @@ type SyncFn = () => FnReturnedObject | void; export type SuiteOptions = $ReadOnly<{ minIterations?: number, - minDuration?: number, + minTestExecutionTimeMs?: number, warmup?: boolean, - minWarmupDuration?: number, + minWarmupDurationMs?: number, minWarmupIterations?: number, disableOptimizedBuildCheck?: boolean, testOnly?: boolean, @@ -141,16 +141,16 @@ export function suite( benchOptions.iterations = suiteOptions.minIterations; } - if (suiteOptions.minDuration != null) { - benchOptions.time = suiteOptions.minDuration; + if (suiteOptions.minTestExecutionTimeMs != null) { + benchOptions.time = suiteOptions.minTestExecutionTimeMs; } if (suiteOptions.warmup != null) { benchOptions.warmup = suiteOptions.warmup; } - if (suiteOptions.minWarmupDuration != null) { - benchOptions.warmupTime = suiteOptions.minWarmupDuration; + if (suiteOptions.minWarmupDurationMs != null) { + benchOptions.warmupTime = suiteOptions.minWarmupDurationMs; } if (suiteOptions.minWarmupIterations != null) { diff --git a/private/react-native-fantom/src/__tests__/benchmarks/BenchmarkTests-testMode-benchmark-itest.js b/private/react-native-fantom/src/__tests__/benchmarks/BenchmarkTests-testMode-benchmark-itest.js index 65eb176583b..366bbb4e7a0 100644 --- a/private/react-native-fantom/src/__tests__/benchmarks/BenchmarkTests-testMode-benchmark-itest.js +++ b/private/react-native-fantom/src/__tests__/benchmarks/BenchmarkTests-testMode-benchmark-itest.js @@ -27,8 +27,8 @@ Fantom.unstable_benchmark warmup: true, minWarmupIterations: 10, minIterations: 10, - minDuration: 1000, - minWarmupDuration: 1000, + minTestExecutionTimeMs: 1000, + minWarmupDurationMs: 1000, }) .test('test', () => { runs++;