From b708d2da6134b467fbcc1df637139b6f26fcdf64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 4 Aug 2025 03:54:58 -0700 Subject: [PATCH] Disable LongTasksAPI on Github CI (#53009) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53009 Changelog: [internal] This disables the test for LongTasks API on Github CI as the execution speed there is unreliable and makes the current tests flaky. This happens because the test is timing dependent, but the alternative would be to mock some core behaviors that I think might be even worse. Reviewed By: cortinico Differential Revision: D79510480 fbshipit-source-id: 277e42e36aa6dfebf4745d094541a667f58a0996 --- .../performance/__tests__/LongTasksAPI-itest.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-native/src/private/webapis/performance/__tests__/LongTasksAPI-itest.js b/packages/react-native/src/private/webapis/performance/__tests__/LongTasksAPI-itest.js index 80c8317318b..11154605bb2 100644 --- a/packages/react-native/src/private/webapis/performance/__tests__/LongTasksAPI-itest.js +++ b/packages/react-native/src/private/webapis/performance/__tests__/LongTasksAPI-itest.js @@ -42,6 +42,16 @@ function ensurePerformanceLongTaskTiming( let observer: ?PerformanceObserver; +const constants = Fantom.getConstants(); +const isGithubCI = constants.isOSS && constants.isRunningFromCI; + +// Skip the test on Github CI. +// In that environment, execution speed is unreliable so some of the tasks +// we schedule as part of the test run (even the task to report long tasks) are +// also being reported as long, and we don't have a way to distinguish those +// from the intentionally long tasks we're scheduling for testing. +const describe = isGithubCI ? global.describe.skip : global.describe; + describe('LongTasks API', () => { afterEach(() => { if (observer) {