StoreKitIntegrationTests: removed incorrect waitUntilCustomerInfoIsUpdated and fixed race condition#1492
Merged
Merged
Conversation
199de6c to
ee63201
Compare
StoreKitIntegrationTests: removed incorrect waitUntilCustomerInfoIsUpdatedStoreKitIntegrationTests: removed incorrect waitUntilCustomerInfoIsUpdated and improved all assertions
Contributor
Author
|
Still looking into the flaky integration test failures. |
StoreKitIntegrationTests: removed incorrect waitUntilCustomerInfoIsUpdated and improved all assertionsStoreKitIntegrationTests: removed incorrect waitUntilCustomerInfoIsUpdated and fixed race condition
fc15fbb to
b14803a
Compare
NachoSoto
commented
Apr 12, 2022
Contributor
Author
There was a problem hiding this comment.
All purchases through this method now verify the entitlement for good measure (instead of most tests doing that repeatedly).
caf0340 to
49e9440
Compare
49e9440 to
bec70ab
Compare
Contributor
Author
|
It's interesting, looking at the trend of failures in |
aboedo
approved these changes
Apr 13, 2022
aboedo
left a comment
Member
There was a problem hiding this comment.
I was convinced I had approved already!! 😅
NachoSoto
added a commit
that referenced
this pull request
Mar 24, 2023
Turns out we had already solved this race condition in #1492 that lead to flaky failures, but it was only in `BaseStoreKitIntegrationTests`. This moves it up to `BaseBackendIntegrationTests` so that `SubscriberAttributesManagerIntegrationTests` can use it too. Fixes https://app.circleci.com/pipelines/github/RevenueCat/purchases-ios/10501/workflows/cb6dbf22-cda8-4c41-875b-04b489992631/jobs/61135
aboedo
pushed a commit
that referenced
this pull request
Mar 27, 2023
…2381) Turns out we had already solved this race condition in #1492 that lead to flaky failures, but it was only in `BaseStoreKitIntegrationTests`. This moves it up to `BaseBackendIntegrationTests` so that `SubscriberAttributesManagerIntegrationTests` can use it too. Fixes https://app.circleci.com/pipelines/github/RevenueCat/purchases-ios/10501/workflows/cb6dbf22-cda8-4c41-875b-04b489992631/jobs/61135
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.
This is probably a leftover from before integration tests got changed to async.
Purchasesinitialization can fetch an updatedCustomerInfo, so assuming this will be 1 is a race condition waiting to happen, because there are potentially multiple customer info requests happening.Also, SDK initialization begins with an initial request to offerings, which results in a get-create of the initial anonymous user. To avoid race conditions with when this request finishes and make all tests deterministic, integration tests now wait for the initial get offerings to finish
Changes:
waitUntilCustomerInfoIsUpdatedverifyEntitlementWentThroughnow callsverifyEntitlementWentThroughto verify theCustomerInfohas the correct entitlementPurchasesDelegate.customerInfoin all tests, which could lead to race conditions