From c482b936b248a158546e31face8e09ec825206b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 15 Apr 2026 02:39:57 -0700 Subject: [PATCH] Skip reporting benchmark results in test mode (#56435) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56435 Avoid printing the result summary table when benchmarks are executed in test mode. In test mode, benchmarks run only a single iteration with no warmup, so the timing results are not meaningful for comparison. The per-suite results table (console.table) was already skipped in test mode, but the benchmark result was still reported to the runner, which could cause the cross-variant comparison table to be printed with meaningless data. This change skips the reportBenchmarkResult call entirely when running in test mode. Changelog: [Internal] Reviewed By: lenaic Differential Revision: D100795458 fbshipit-source-id: 910f0aa5615ea07fd19b3703a2774e13b4531743 --- private/react-native-fantom/src/Benchmark.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/private/react-native-fantom/src/Benchmark.js b/private/react-native-fantom/src/Benchmark.js index a4b8af047b7..f93912bc967 100644 --- a/private/react-native-fantom/src/Benchmark.js +++ b/private/react-native-fantom/src/Benchmark.js @@ -215,7 +215,9 @@ export function suite( 'Failing focused test to prevent it from being committed', ); } - reportBenchmarkResult(createBenchmarkResultsObject(bench, tasks)); + if (!isTestOnly) { + reportBenchmarkResult(createBenchmarkResultsObject(bench, tasks)); + } }); const test = (name: string, fn: SyncFn, options?: FnOptions): SuiteAPI => {