Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration Tests: simplified testIneligibleForIntroAfterPurchaseExpires to fix flakiness #1952

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

NachoSoto
Copy link
Contributor

@NachoSoto NachoSoto commented Sep 28, 2022

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 aboedo and a team 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.
Copy link
Contributor

@vegaro vegaro left a comment

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
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