Skip to content

Conversation

@ajpallares
Copy link
Member

StoreKitObserverModeIntegrationTests' testDoesNotSyncExistingSK2Purchases() and testObservingTransactionUnlocksEntitlement() are sometimes failing.

Recent failures here

I suspect the failures happen because, sometimes, changes to the SKTestSession do not reflect immediately in StoreKit. The potential fix makes sure to double check that when deleting all transactions from SKTestSession, StoreKit indeeds reflects it before continuing with the test execution.
This hypothesis and the implemented workaround were greatly inspired by https://github.com/dropbox/StoreKitTestHelpers

…ns from SKTestSession

Trying to reduce the flakiness of failed tests in https://app.circleci.com/pipelines/github/RevenueCat/purchases-ios/32195/workflows/fda6c174-617d-44bd-a997-ad2a9a36de4d/jobs/421143/tests (`testDoesNotSyncExistingSK2Purchases()` and `testObservingTransactionUnlocksEntitlement()`)
…entify the transaction id and the source of that purchase

This could help debugging flaky tests as sometimes we get a "Finishing transaction" log in a test that is actually finishing the transaction generated in a different test
…Tests`' `testPostsPurchasePerformedOnFallbackURLWhenRecoveringAfterRestartToMainServer()`

By asserting the Finishing transaction log only against the actual expected transaction
…ngMultipleProductsWhileServerIsDownHandlesAllTransactionsWhenForegroundingApp()`
…ansactions from SKTestSession"

This reverts commit eab98f6.

# Conflicts:
#	Tests/StoreKitUnitTests/TestHelpers/StoreKitTestHelpers.swift
…ransactions from SKTestSession"

This reverts commit 31741a7.
Base automatically changed from fix-more-flaky-tests to main December 12, 2025 16:20
# Conflicts:
#	Tests/BackendIntegrationTests/Helpers/ExternalPurchasesManager.swift
@ajpallares ajpallares force-pushed the workaround-to-reduce-some-tests-flakiness branch from 446f02e to f468569 Compare December 16, 2025 09:30
@RevenueCat-Danger-Bot
Copy link

Danger has errored

[!] Invalid Dangerfile file: SIGTERM

 #  from Dangerfile:35
 #  -------------------------------------------
 #  
 >    project = Xcodeproj::Project.open(project_file)
 #    root = Pathname.pwd
 #  -------------------------------------------

Generated by 🚫 Danger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants