Skip to content

Integration Tests: changed weekly to monthly subscriptions to work around 0-second subscriptions#2039

Merged
NachoSoto merged 1 commit into
integration-test-ask-to-buyfrom
integration-tests-monthly
Nov 9, 2022
Merged

Integration Tests: changed weekly to monthly subscriptions to work around 0-second subscriptions#2039
NachoSoto merged 1 commit into
integration-test-ask-to-buyfrom
integration-tests-monthly

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Nov 9, 2022

Copy link
Copy Markdown
Contributor

As exposed by #2038, weekly subscriptions were leading to false negatives because they were always expired by the time the purchase was made (using TimeRate.monthlyRenewalEveryThirtySeconds), instead of lasting 10 seconds as documented. This is reported as FB11767559.

The advantage of using weekly subscriptions was to also work around FB11767679, which means that we have to manually wait for the subscription to expire, as SKTestSession.expireSubscription(productIdentifier:) doesn't actually change the receipt.
Because we had to wait, using weekly subscriptions was faster, since we only needed to wait 10 seconds.

This does mean that expirations in these tests now have to wait 30 seconds instead of 10, but now they're no longer flaky 🎉
Looks like tests right now pass in CI in less than 7 minutes, which I believe is totally acceptable, especially for the benefit of no longer having these flaky tests.

@NachoSoto NachoSoto added the test label Nov 9, 2022
@NachoSoto NachoSoto requested a review from a team November 9, 2022 00:43
@NachoSoto NachoSoto changed the base branch from main to integration-test-ask-to-buy November 9, 2022 01:05
…around 0-second subscriptions

As exposed by #2038, weekly subscriptions were leading to false negatives because they were always expired by the time the purchase was made using `TimeRate.monthlyRenewalEveryThirtySeconds`, instead of lasting 10 seconds as documented.
(`FB11767559`)

The advantage of using weekly subscriptions was to also work around `FB11767679`, which means that we have to manually _wait_ for the subscription to expire, as `SKTestSession.expireSubscription(productIdentifier:)` doesn't actually change the receipt.
Because we had to wait, using weekly subscriptions was faster, since we only needed to wait 10 seconds.

This does mean that expirations in these tests now have to wait 30 seconds instead of 10, but now they're no longer flaky 🎉
@NachoSoto NachoSoto force-pushed the integration-tests-monthly branch from f99328a to 021fed0 Compare November 9, 2022 01:06

@aboedo aboedo 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.

Looks like tests right now pass in CI in less than 7 minutes, which I believe it totally acceptable, especially for the benefit of no longer having these flaky tests.

💯

@NachoSoto NachoSoto merged this pull request into integration-test-ask-to-buy Nov 9, 2022
@NachoSoto NachoSoto deleted the integration-tests-monthly branch November 9, 2022 14:23
@NachoSoto NachoSoto restored the integration-tests-monthly branch November 9, 2022 14:25
@NachoSoto

Copy link
Copy Markdown
Contributor Author

Oops I merged this into the other branch, let me re-open the PR..

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.

3 participants