Skip to content

[in_app_purchase_storekit] add warm up test to preaction - #13661

Merged
auto-submit[bot] merged 3 commits into
flutter:mainfrom
LouiseHsu:storekit-test-warmup
Nov 17, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:mainfrom
LouiseHsu:storekit-test-warmup

Conversation

@LouiseHsu

@LouiseHsu LouiseHsu commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Basically, when you run StoreKitTest tests, it opens a connection to the Storekit daemon, then it pushes the storekit configuration a few ms later. The daemon, however, decides at connection time if we're in the testing environment or the sandbox. So on first run, there's no configuration on device yet, so it tries to connect to the sandbox. The tests hang for 60 secs cuz on device you get a Sign In to Apple popup. However subsequent tests will pass, because now the config exists on the device.

So, this pr adds a test pre-action to the Runner scheme that runs one non-purchase test in a throwaway process before the real test host launches.

this is an Apple bug for sure. It actually shows up finally in the 27.3 patchnotes

Heres a passing led run https://ci.chromium.org/b/8665196748563787521

Fixes flutter/flutter#195494

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1].
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
  • All existing and new tests are passing.

… tests

On iOS 27 simulators, the first process to use SKTestSession on a
never-used simulator gets its StoreKit connection classified as sandbox
before the test configuration has been pushed to the device, so every
StoreKit 2 purchase hangs on an Apple Account sign-in and times out
(Apple FB24651858 / 186670057, listed as a known issue in the iOS 27.3
release notes). Any later process on the same device works, which is
why the tests pass on reused simulators and fail on CI's fresh ones.

Add a Test pre-action to the Runner scheme that runs one non-purchase
test in a throwaway process before the real test host launches. This is
Apple's documented workaround (seed the configuration on the device
first), automated for xcodebuild, which ignores the scheme's StoreKit
configuration setting that makes it work from the IDE.

Fixes flutter/flutter#195494
@LouiseHsu LouiseHsu added the CICD Run CI/CD label Nov 14, 2026
@LouiseHsu
LouiseHsu requested a review from vashworth November 14, 2026 04:38
@github-actions github-actions Bot added the P1 High-priority issues at the top of the work list label Nov 14, 2026
@LouiseHsu
LouiseHsu marked this pull request as ready for review November 14, 2026 04:38
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If both you and the PR author believe this PR qualifies for a test exemption, escalate to the tech lead for the changed area to review and apply the test-exempt label. All reviewers should feel empowered to ask for tests before escalating.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a pre-action shell script to the Xcode scheme Runner.xcscheme to warm up StoreKit testing on cold simulators. The review feedback suggests adding defensive checks to the script to ensure environment variables like $PROJECT_DIR, $BUILD_DIR, $TARGET_DEVICE_IDENTIFIER, and $TMPDIR are set before executing xcodebuild or writing logs.

@LouiseHsu LouiseHsu added the CICD Run CI/CD label Nov 16, 2026
@LouiseHsu
LouiseHsu requested a review from vashworth November 17, 2026 01:15
@vashworth

Copy link
Copy Markdown
Contributor

Test exemption: the files changed are part of the test itself

@vashworth vashworth added test-exempt Exempt from tests. Overrides `missing-tests` label autosubmit Merge PR when tree becomes green via auto submit App labels Nov 17, 2026
@auto-submit
auto-submit Bot merged commit 9af69be into flutter:main Nov 17, 2026
13 checks passed
ditman pushed a commit to ditman/flutter-flutter that referenced this pull request Nov 17, 2026
…r#196812)

flutter/packages@4c6a7d3...9af69be

2026-11-17 [email protected] [in_app_purchase_storekit] add warm up
test to preaction (flutter/packages#13661)
2026-11-17 [email protected] Roll Flutter from
d8bd864 to 2f09f96 (27 revisions) (flutter/packages#13695)
2026-11-17 [email protected] [url_launcher] Convert implementation
to Kotlin (flutter/packages#13663)
2026-11-17 [email protected] [cupertino_ui] Prevent null-check crash
during CupertinoTextSelectionToolbar pagination (flutter/packages#13659)
2026-11-17 [email protected] [ci] Allow
backfilling missed releases via workflow_dispatch
(flutter/packages#13612)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD missing-tests p: in_app_purchase P1 High-priority issues at the top of the work list platform-ios platform-macos test-exempt Exempt from tests. Overrides `missing-tests` label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Xcode 27] Multiple in_app_purchase_storekit tests fail with Xcode 27

2 participants