Skip Performance timeOrigin test on macOS hosts (#56991)#56991
Closed
rubennorte wants to merge 2 commits into
Closed
Skip Performance timeOrigin test on macOS hosts (#56991)#56991rubennorte wants to merge 2 commits into
rubennorte wants to merge 2 commits into
Conversation
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106669674. |
22e8b77 to
a8a5c5e
Compare
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
May 29, 2026
Summary: The `timeOrigin` test in `Performance-itest` compares `performance.now() + performance.timeOrigin` against `Date.now()`. On macOS this comparison is unreliable because `performance.now()` is backed by a monotonic clock that does NOT advance while the system is asleep, so the monotonic time drifts relative to wall time the longer the machine has been running. Use the new `Fantom.getHostPlatform()` to skip just this test on macOS hosts while keeping it active on other platforms. A comment explains why the test cannot be run there. Also adds a small test verifying that `performance.timeOrigin` is a positive number and is stable across calls. Changelog: [Internal] Reviewed By: javache Differential Revision: D106669674
a8a5c5e to
a8b9f7f
Compare
…56990) Summary: Adds a new `Fantom.getHostPlatform()` API that returns the host operating system where the Fantom test runner is running (e.g. 'linux', 'macos', 'windows', 'android'). This is different from React Native's `Platform.OS`, which always reflects the React Native target platform being tested. The value is determined by the Node.js Jest runner (via `process.platform`) and baked into the JS bundle through the existing `setConstants(...)` pipeline, so no native changes are needed. - Add `HostPlatform` type and `hostPlatform` field to `FantomRuntimeConstants`. - Populate `hostPlatform` from the host platform in the entrypoint template (maps darwin -> macos, win32 -> windows, etc.). - Expose `getHostPlatform()` from the public Fantom API. Changelog: [Internal] Reviewed By: javache Differential Revision: D106669673
Summary: The `timeOrigin` test in `Performance-itest` compares `performance.now() + performance.timeOrigin` against `Date.now()`. On macOS this comparison is unreliable because `performance.now()` is backed by a monotonic clock that does NOT advance while the system is asleep, so the monotonic time drifts relative to wall time the longer the machine has been running. Use the new `Fantom.getHostPlatform()` to skip just this test on macOS hosts while keeping it active on other platforms. A comment explains why the test cannot be run there. Also adds a small test verifying that `performance.timeOrigin` is a positive number and is stable across calls. Changelog: [Internal] Reviewed By: javache Differential Revision: D106669674
a8b9f7f to
e990856
Compare
|
This pull request has been merged in 540c741. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The
timeOrigintest inPerformance-itestcomparesperformance.now() + performance.timeOriginagainstDate.now(). OnmacOS this comparison is unreliable because
performance.now()isbacked by a monotonic clock that does NOT advance while the system is
asleep, so the monotonic time drifts relative to wall time the longer
the machine has been running.
Use the new
Fantom.getHostPlatform()to skip just this test on macOShosts while keeping it active on other platforms. A comment explains
why the test cannot be run there.
Also adds a small test verifying that
performance.timeOriginis apositive number and is stable across calls.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D106669674