Skip to content

Commit

Permalink
Integration Tests: fixed more flaky failures (#3218)
Browse files Browse the repository at this point in the history
Same as #3167. These can fail when verifying that no transactions are
finished because there might be leftover transactions before the test
even begins. In order to ignore those, we clear `TestLogHandler` at the
beginning. We don't do that for every test because in some test we want
to look at what was logged during SDK initialization.
  • Loading branch information
NachoSoto committed Sep 15, 2023
1 parent 04e4867 commit 5ba3fb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class OfflineStoreKit1IntegrationTests: BaseOfflineStoreKitIntegrationTests {

@available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *)
func testPurchaseWhileServerIsDownSucceedsButDoesNotFinishTransaction() async throws {
self.logger.clearMessages()

self.serverDown()
try await self.purchaseMonthlyProduct()

Expand All @@ -114,6 +116,8 @@ class OfflineStoreKit1IntegrationTests: BaseOfflineStoreKitIntegrationTests {

@available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *)
func testPurchaseWhileServerIsDownPostsReceiptAfterServerComesBack() async throws {
self.logger.clearMessages()

// 1. Purchase while server is down
self.serverDown()
try await self.purchaseMonthlyProduct()
Expand Down Expand Up @@ -292,6 +296,8 @@ class OfflineStoreKit1IntegrationTests: BaseOfflineStoreKitIntegrationTests {

@available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *)
func testPurchaseWhileServerIsDownPostsReceiptWhenForegroundingApp() async throws {
self.logger.clearMessages()

// 1. Purchase while server is down
self.serverDown()
try await self.purchaseMonthlyProduct()
Expand Down
1 change: 1 addition & 0 deletions Tests/TestPlans/CI-BackendIntegration.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
}
],
"maximumTestExecutionTimeAllowance" : 180,
"maximumTestRepetitions" : 5,
"repeatInNewRunnerProcess" : true,
"targetForVariableExpansion" : {
"containerPath" : "container:RevenueCat.xcodeproj",
Expand Down

0 comments on commit 5ba3fb2

Please sign in to comment.