Skip to content

Fix Fantom dev-mode tests when the tester is built in optimized mode#57272

Closed
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D109014401
Closed

Fix Fantom dev-mode tests when the tester is built in optimized mode#57272
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D109014401

Conversation

@rubennorte

Copy link
Copy Markdown
Contributor

Summary:
Fantom integration tests declared with fantom_mode dev rely on debug-only native APIs (e.g. timer mocking via installHighResTimeStampMock) that are only compiled when the native tester is built in debug mode.

Under some build configurations the active platform pins the core build mode to optimized, so the preprocessor flag that gates those debug-only APIs is not defined and the tester is compiled in optimized mode. As a result, dev-mode tests that depend on those APIs throw at runtime (e.g. "Mocking timers is not supported in optimized builds").

A previous attempt stacked a build-mode constraint on the Hermes build mode setting, which the native preprocessor flags never read, so it had no effect. Stack the constraint on the core build mode setting that actually gates the flag instead, so the tester is compiled in the test's intended dev/opt mode.

Changelog: [Internal]

Differential Revision: D109014401

Summary:
Fantom integration tests declared with `fantom_mode dev` rely on debug-only native APIs (e.g. timer mocking via `installHighResTimeStampMock`) that are only compiled when the native tester is built in debug mode.

Under some build configurations the active platform pins the core build mode to optimized, so the preprocessor flag that gates those debug-only APIs is not defined and the tester is compiled in optimized mode. As a result, dev-mode tests that depend on those APIs throw at runtime (e.g. "Mocking timers is not supported in optimized builds").

A previous attempt stacked a build-mode constraint on the Hermes build mode setting, which the native preprocessor flags never read, so it had no effect. Stack the constraint on the core build mode setting that actually gates the flag instead, so the tester is compiled in the test's intended dev/opt mode.

Changelog: [Internal]

Differential Revision: D109014401
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 18, 2026
@meta-codesync

meta-codesync Bot commented Jun 18, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109014401.

@meta-codesync

meta-codesync Bot commented Jun 18, 2026

Copy link
Copy Markdown

This pull request has been merged in e1b0c77.

@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant