Skip to content

[in_app_purchase_storekit] Address flaky tests#11270

Open
LouiseHsu wants to merge 6 commits intoflutter:mainfrom
LouiseHsu:storekit-test-flakes
Open

[in_app_purchase_storekit] Address flaky tests#11270
LouiseHsu wants to merge 6 commits intoflutter:mainfrom
LouiseHsu:storekit-test-flakes

Conversation

@LouiseHsu
Copy link
Contributor

@LouiseHsu LouiseHsu commented Mar 16, 2026

Fixes flutter/flutter#182845
Probably fixes flutter/flutter#183318

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.

If you need help, consider asking for advice on the #hackers-new channel on [Discord].

@LouiseHsu LouiseHsu added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 16, 2026
@LouiseHsu LouiseHsu added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 17, 2026
@LouiseHsu LouiseHsu added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 17, 2026
@LouiseHsu LouiseHsu changed the title test flakes [in_app_purchase_storekit] Address flaky tests Mar 17, 2026
@LouiseHsu LouiseHsu added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 17, 2026
@LouiseHsu LouiseHsu marked this pull request as ready for review March 17, 2026 23:25
Copy link

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

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 addresses flaky tests in InAppPurchaseStoreKit2PluginTests.swift by skipping certain tests on a specific OS version known to have a StoreKit bug, and by increasing the timeout for two other tests. My review focuses on improving the maintainability of these changes. I've suggested extracting duplicated test-skipping logic into a helper function and replacing a magic number for a timeout with a named constant. These changes will make the test suite cleaner and easier to manage.

@LouiseHsu LouiseHsu removed the CICD Run CI/CD label Mar 17, 2026
@LouiseHsu LouiseHsu added the CICD Run CI/CD label Mar 17, 2026
Comment on lines +184 to +188
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
try XCTSkipIf(
osVersion.majorVersion == 23 && osVersion.minorVersion == 2,
"Known StoreKitTest bug on Xcode 23.2 with setSimulatedError() when used on .loadProducts API"
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://developer.apple.com/forums/thread/808030
.setSimulatedError doesnt work on specifically 26.2, but apples availability annotation doesnt support donut hole versioning.

@stuartmorgan-g stuartmorgan-g added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants