Skip to content

Integration Tests: simplified testIneligibleForIntroAfterPurchaseExpires to fix flakiness#1952

Merged
NachoSoto merged 2 commits into
mainfrom
expire-subscription-flaky-test
Sep 29, 2022
Merged

Integration Tests: simplified testIneligibleForIntroAfterPurchaseExpires to fix flakiness#1952
NachoSoto merged 2 commits into
mainfrom
expire-subscription-flaky-test

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Sep 28, 2022

Copy link
Copy Markdown
Contributor

Fixes CSDK-479.

Changes:

  • Removed extra verifyEntitlementWentThrough. Integration Tests: actually verify that entitlement is active #1880 introduced a change so that weekly subscriptions aren't verified, because they expire within a second. This make the test flaky due to that race condition.
  • Removed assertNoActiveSubscription: I tried calling SKTestSession.disableAutoRenewForTransaction, but sometimes the server still thinks the subscription has auto-renewed. This was making the test flaky. Turns out that even if it's not active, the eligibility test still passes as expected.
  • Removed call to syncPurchases. It doesn't matter what state the server is in, as long as locally SKTestSession has an expired subscription.

This, together with #1945, should fix the last of the issues causing flaky integration tests 🤞🏻

@NachoSoto NachoSoto added the test label Sep 28, 2022
@NachoSoto NachoSoto requested review from a team and aboedo September 28, 2022 19:55
…xpires` to fix flakiness

Fixes [CSDK-479].

### Changes:
- Removed extra `verifyEntitlementWentThrough`. #1880 introduced a change so that weekly subscriptions aren't verified, because they expire within a second. This make the test flaky due to that race condition.
- Removed `assertNoActiveSubscription`: I tried calling `SKTestSession.disableAutoRenewForTransaction`, but sometimes the server still thinks the subscription has auto-renewed. This was making the test flaky. Turns out that even if it's not active, the eligibility test still passes as expected.
@NachoSoto NachoSoto force-pushed the expire-subscription-flaky-test branch from 946fadf to 274097e Compare September 28, 2022 20:23

@vegaro vegaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried calling SKTestSession.disableAutoRenewForTransaction, but sometimes the server still thinks the subscription has auto-renewed.

Is this an issue we should fix?

@NachoSoto

Copy link
Copy Markdown
Contributor Author

I talked about it with @aboedo. The backend has no way of knowing if an SKTestSession subscription is going to renew or not.

@NachoSoto NachoSoto merged commit b31399d into main Sep 29, 2022
@NachoSoto NachoSoto deleted the expire-subscription-flaky-test branch September 29, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants