Skip to content

Commit b708d2d

Browse files
rubennortefacebook-github-bot
authored andcommitted
Disable LongTasksAPI on Github CI (#53009)
Summary: Pull Request resolved: #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
1 parent 4289cff commit b708d2d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packages/react-native/src/private/webapis/performance/__tests__/LongTasksAPI-itest.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ function ensurePerformanceLongTaskTiming(
4242

4343
let observer: ?PerformanceObserver;
4444

45+
const constants = Fantom.getConstants();
46+
const isGithubCI = constants.isOSS && constants.isRunningFromCI;
47+
48+
// Skip the test on Github CI.
49+
// In that environment, execution speed is unreliable so some of the tasks
50+
// we schedule as part of the test run (even the task to report long tasks) are
51+
// also being reported as long, and we don't have a way to distinguish those
52+
// from the intentionally long tasks we're scheduling for testing.
53+
const describe = isGithubCI ? global.describe.skip : global.describe;
54+
4555
describe('LongTasks API', () => {
4656
afterEach(() => {
4757
if (observer) {

0 commit comments

Comments
 (0)