Fantom's shouldCollectCoverage answers true on every second call for the same benchmark: FANTOM_BENCHMARK_FILENAME_RE has the g flag
Los mantenedores suelen responder en 2 días
@jipeng6036-del ya está trabajando en esto.
Desde el 16/11/2026.
- #60056 de @jipeng6036-del — abierto
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, react-native
Línea de trabajo
Read private/react-native-fantom/runner/coverageUtils.js, especially the regex declaration and shouldCollectCoverage, then inspect the related test area under private/react-native-fantom/runner/__tests__/. Start by running the supplied reproducer or the described Jest test; done means repeated calls return [false, false, false] for a benchmark and [true, true, true] for a non-benchmark. An open linked pull request (#60056) already addresses this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
private/react-native-fantom/runner/coverageUtils.js declares FANTOM_BENCHMARK_FILENAME_RE = /[Bb]enchmark-itest\./g (L16), and shouldCollectCoverage calls .test() on it (L23). With the g flag, .test() starts from the lastIndex of the previous match, so asked three times for the same benchmark path with collectCoverage: true, shouldCollectCoverage answers [false, true, false].
runner.js calls shouldCollectCoverage once per config, inside for (const testConfig of testConfigs) (L300, L387-L391), and passes the answer to the bundle's collectCoverage (L402), LLVM_PROFILE_FILE (L438) and the tester's enableCoverage (L444). So in a --coverage run, every other config of a benchmark with several configs runs with coverage. getFantomTestConfigs.js declares the same pattern without the flag (L75, https://github.com/react/react-native/pull/56423).
Steps to reproduce
- In a checkout of
main(61448351cc2) afteryarn install, putcoverageBenchmark-test.jsfrom the reproducer below inprivate/react-native-fantom/runner/__tests__/and runyarn jest private/react-native-fantom/runner/__tests__/coverageBenchmark-test.js; or runnode repro.cjs <path to the checkout>from the reproducer, which copies that test in, runs it, removes it, and exits 1 while the defect shows.
const globalConfig = {collectCoverage: true};
// The runner asks once per config of a test, always with the same path.
function askThreeTimes(testPath) {
return [1, 2, 3].map(() =>
shouldCollectCoverage(testPath, '', globalConfig),
);
}
Expected: askThreeTimes('View-benchmark-itest.js') is [false, false, false], and askThreeTimes('View-itest.js') stays [true, true, true].
Actual: askThreeTimes('View-benchmark-itest.js') is [false, true, false].
React Native Version
main at 61448351cc2 (nightly)
Affected Platforms
Build - Windows
Output of npx @react-native-community/cli info
Not applicable: this is Fantom's runner in React Native's own repository. The reproducer's run:
react-native 61448351cc2 (2026-11-16), Windows_NT 10.0.26300, node v26.12.1
Stacktrace or Logs
react-native 61448351cc2 (2026-11-16), Windows_NT 10.0.26300, node v26.12.1
private/react-native-fantom/runner/coverageUtils.js: const FANTOM_BENCHMARK_FILENAME_RE = /[Bb]enchmark-itest\./g;
copied coverageBenchmark-test.js to private/react-native-fantom/runner/__tests__/
$ yarn jest private/react-native-fantom/runner/__tests__/coverageBenchmark-test.js
removed private/react-native-fantom/runner/__tests__/coverageBenchmark-test.js
jest exited 1
failed: never collects coverage for a benchmark, however often it is asked
passed: collects coverage for a test that is not a benchmark
shouldCollectCoverage('View-benchmark-itest.js', '', {collectCoverage: true}), asked 3 times: [false, true, false]
shouldCollectCoverage('View-itest.js', '', {collectCoverage: true}), asked 3 times: [true, true, true]
SUMMARY: shouldCollectCoverage answers [false, true, false] for the same benchmark path asked 3 times with collectCoverage: true; expected [false, false, false]
MANDATORY Reproducer
https://gist.github.com/YevheniiKotyrlo/4bda8e7c8af665c0639274ee15918482 — node repro.cjs <path to a react-native checkout> exits 1 while a benchmark gets true on any of the three calls, and 0 once it gets false every time and the other test true every time.
Screenshots and Videos
No response
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.5k
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 235
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react/react-native
-
Needs: Author Feedback Needs: Repro
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
react/react-native#60059 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
react/react-native#60000 ·
Los mantenedores suelen responder en 2 días
-
`yarn test-ios` exits before building RNTester: `objc-test.sh` launches the WebSocket server script #59433 deletedPosiblemente ocupada @lazerg la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
react/react-native#59939 ·
Los mantenedores suelen responder en 2 días
-
iOS Fabric pointer-handler reset leaves the next lone touch non-primaryPosiblemente ocupada @alleneubank la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
react/react-native#59919 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
react/react-native#59722 ·
Los mantenedores suelen responder en 2 días
Todos los issues de react/react-native
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
petercorke/robotics-toolbox-python#943 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:build bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
NatronGitHub/openfx-arena#71 ·
Los mantenedores suelen responder en 1 día
-
upstream-watcher: Netflix/vmaf cf677baaa039 is not portedPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoupstream-blocked
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ROCm/FastFlowLM#1057 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
NatronGitHub/openfx-gmic#45 ·
Los mantenedores suelen responder en 1 día