diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginAuthCognitoTests/AWSDataStoreCategoryPluginAuthIntegrationTests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginAuthCognitoTests/AWSDataStoreCategoryPluginAuthIntegrationTests.swift index 0a2efbf5db..6820024eb2 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginAuthCognitoTests/AWSDataStoreCategoryPluginAuthIntegrationTests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginAuthCognitoTests/AWSDataStoreCategoryPluginAuthIntegrationTests.swift @@ -53,14 +53,10 @@ class AWSDataStoreCategoryPluginAuthIntegrationTests: AWSDataStoreAuthBaseTest { syncReceivedInvoked.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: syncReceivedListener, timeout: 5.0) else { - XCTFail("syncReceivedListener registered for hub") - return - } try await signIn(user: user1) - await fulfillment(of: [syncReceivedInvoked], timeout: TestCommonConstants.networkTimeout) + await fulfillment(of: [syncReceivedInvoked], timeout: 60) Amplify.Hub.removeListener(syncReceivedListener) guard let remoteTodo = remoteTodoOptional else { XCTFail("Should have received a SyncReceived event with the remote note reconciled to local store") diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario1Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario1Tests.swift index bb4d290b87..7fcc844786 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario1Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario1Tests.swift @@ -60,10 +60,7 @@ class DataStoreConnectionScenario1Tests: SyncEngineIntegrationTestBase { syncedTeamReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) await fulfillment(of: [syncedTeamReceived], timeout: networkTimeout) @@ -81,10 +78,7 @@ class DataStoreConnectionScenario1Tests: SyncEngineIntegrationTestBase { syncProjectReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(project) await fulfillment(of: [syncProjectReceived], timeout: networkTimeout) @@ -122,10 +116,7 @@ class DataStoreConnectionScenario1Tests: SyncEngineIntegrationTestBase { syncUpdatedProjectReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + project.team = anotherTeam _ = try await Amplify.DataStore.save(project) await fulfillment(of: [syncUpdatedProjectReceived], timeout: networkTimeout) @@ -168,10 +159,7 @@ class DataStoreConnectionScenario1Tests: SyncEngineIntegrationTestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) _ = try await Amplify.DataStore.save(project) @@ -198,10 +186,7 @@ class DataStoreConnectionScenario1Tests: SyncEngineIntegrationTestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(project) // TODO: Delete Team should not be necessary, cascade delete should delete the team when deleting the project. diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario2Tests.swift index 820b191aaf..18e21a944e 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario2Tests.swift @@ -65,10 +65,7 @@ class DataStoreConnectionScenario2Tests: SyncEngineIntegrationTestBase { syncProjectReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) await fulfillment(of: [syncedTeamReceived], timeout: networkTimeout) @@ -101,10 +98,7 @@ class DataStoreConnectionScenario2Tests: SyncEngineIntegrationTestBase { syncUpdatedProjectReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) _ = try await Amplify.DataStore.save(anotherTeam) @@ -158,10 +152,7 @@ class DataStoreConnectionScenario2Tests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + try await Amplify.DataStore.save(team) try await Amplify.DataStore.save(project) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario3Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario3Tests.swift index 15fc8f9d1f..da7b4f8c06 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario3Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/Connection/DataStoreConnectionScenario3Tests.swift @@ -65,10 +65,7 @@ class DataStoreConnectionScenario3Tests: SyncEngineIntegrationTestBase { syncCommentReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [syncedPostReceived], timeout: networkTimeout) _ = try await Amplify.DataStore.save(comment) diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreConsecutiveUpdatesTests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreConsecutiveUpdatesTests.swift index eb21319b2e..643281de82 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreConsecutiveUpdatesTests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreConsecutiveUpdatesTests.swift @@ -70,10 +70,7 @@ class DataStoreConsecutiveUpdatesTests: SyncEngineIntegrationTestBase { } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + // Post is saved and then immediately updated _ = try await Amplify.DataStore.save(newPost) @@ -146,10 +143,7 @@ class DataStoreConsecutiveUpdatesTests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + // Post is saved and then immediately deleted _ = try await Amplify.DataStore.save(newPost) @@ -230,10 +224,7 @@ class DataStoreConsecutiveUpdatesTests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + // save the post, update and delete immediately _ = try await Amplify.DataStore.save(newPost) @@ -319,10 +310,7 @@ class DataStoreConsecutiveUpdatesTests: SyncEngineIntegrationTestBase { } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(newPost) await fulfillment(of: [saveSyncReceived], timeout: networkTimeout) diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreCustomPrimaryKeyTests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreCustomPrimaryKeyTests.swift index 1c89de647a..539d75a489 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreCustomPrimaryKeyTests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreCustomPrimaryKeyTests.swift @@ -62,10 +62,7 @@ class DataStoreCustomPrimaryKeyTests: SyncEngineIntegrationTestBase { return } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + // create customer order _ = try await Amplify.DataStore.save(customerOrder) @@ -97,10 +94,7 @@ class DataStoreCustomPrimaryKeyTests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(updatedCustomerOrder) await fulfillment(of: [updateReceived], timeout: networkTimeout) @@ -138,10 +132,7 @@ class DataStoreCustomPrimaryKeyTests: SyncEngineIntegrationTestBase { return } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(CustomerOrder.self, withIdentifier: updatedCustomerOrder.id) await fulfillment(of: [deleteReceived], timeout: networkTimeout) diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreEndToEndTests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreEndToEndTests.swift index 1576d90407..c7eb98da49 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreEndToEndTests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginIntegrationTests/DataStoreEndToEndTests.swift @@ -155,10 +155,7 @@ class DataStoreEndToEndTests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(newPost) await fulfillment(of: [createReceived], timeout: networkTimeout) @@ -186,10 +183,7 @@ class DataStoreEndToEndTests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(updatedPost) await fulfillment(of: [updateReceived], timeout: networkTimeout) @@ -216,10 +210,7 @@ class DataStoreEndToEndTests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + try await Amplify.DataStore.delete(updatedPost) await fulfillment(of: [deleteReceived], timeout: networkTimeout) } @@ -265,10 +256,7 @@ class DataStoreEndToEndTests: SyncEngineIntegrationTestBase { return } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(newPost) await fulfillment(of: [createReceived], timeout: networkTimeout) @@ -295,10 +283,7 @@ class DataStoreEndToEndTests: SyncEngineIntegrationTestBase { return } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(updatedPost, where: post.title == title) await fulfillment(of: [updateReceived], timeout: networkTimeout) } @@ -351,10 +336,7 @@ class DataStoreEndToEndTests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(newPost) await fulfillment(of: [createReceived], timeout: networkTimeout) @@ -393,10 +375,7 @@ class DataStoreEndToEndTests: SyncEngineIntegrationTestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(updatedPost, where: post.content == updatedPost.content) @@ -679,10 +658,7 @@ class DataStoreEndToEndTests: SyncEngineIntegrationTestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(newPost) diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario1V2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario1V2Tests.swift index 4bdfa9c164..84246c0e83 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario1V2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario1V2Tests.swift @@ -61,10 +61,7 @@ class DataStoreConnectionScenario1V2Tests: SyncEngineIntegrationV2TestBase { syncedTeamReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) await fulfillment(of: [syncedTeamReceived], timeout: TestCommonConstants.networkTimeout) @@ -85,10 +82,7 @@ class DataStoreConnectionScenario1V2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(project) await fulfillment(of: [syncProjectReceived], timeout: TestCommonConstants.networkTimeout) @@ -132,10 +126,7 @@ class DataStoreConnectionScenario1V2Tests: SyncEngineIntegrationV2TestBase { syncUpdatedProjectReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + project.project1V2TeamId = anotherTeam.id _ = try await Amplify.DataStore.save(project) @@ -182,10 +173,7 @@ class DataStoreConnectionScenario1V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) _ = try await Amplify.DataStore.save(project) @@ -207,10 +195,7 @@ class DataStoreConnectionScenario1V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + project.name = "updatedName" _ = try await Amplify.DataStore.save(project) @@ -237,10 +222,7 @@ class DataStoreConnectionScenario1V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(project) // TODO: Delete Team should not be necessary, cascade delete should delete the team when deleting the project. @@ -284,10 +266,7 @@ class DataStoreConnectionScenario1V2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) _ = try await Amplify.DataStore.save(project) @@ -315,10 +294,7 @@ class DataStoreConnectionScenario1V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(project) // TODO: Delete Team should not be necessary, cascade delete should delete the team when deleting the project. diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario2V2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario2V2Tests.swift index 5c30589420..f2a0f95504 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario2V2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario2V2Tests.swift @@ -62,10 +62,7 @@ class DataStoreConnectionScenario2V2Tests: SyncEngineIntegrationV2TestBase { syncedTeamReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) await fulfillment(of: [syncedTeamReceived], timeout: TestCommonConstants.networkTimeout) @@ -122,10 +119,7 @@ class DataStoreConnectionScenario2V2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + project.teamID = anotherTeam.id project.team = anotherTeam @@ -170,10 +164,7 @@ class DataStoreConnectionScenario2V2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) _ = try await Amplify.DataStore.save(project) @@ -195,10 +186,7 @@ class DataStoreConnectionScenario2V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + project.name = "updatedName" _ = try await Amplify.DataStore.save(project) @@ -225,10 +213,7 @@ class DataStoreConnectionScenario2V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(project) // TODO: Delete Team should not be necessary, cascade delete should delete the team when deleting the project. // Once cascade works for hasOne, the following code can be removed. @@ -272,10 +257,7 @@ class DataStoreConnectionScenario2V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(team) _ = try await Amplify.DataStore.save(project) @@ -303,10 +285,7 @@ class DataStoreConnectionScenario2V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(project) // TODO: Delete Team should not be necessary, cascade delete should delete the team when deleting the project. diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario3V2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario3V2Tests.swift index 2ca3fa52a2..a60b268b6a 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario3V2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario3V2Tests.swift @@ -63,10 +63,7 @@ class DataStoreConnectionScenario3V2Tests: SyncEngineIntegrationV2TestBase { syncCommentReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) _ = try await Amplify.DataStore.save(comment) @@ -163,10 +160,7 @@ class DataStoreConnectionScenario3V2Tests: SyncEngineIntegrationV2TestBase { createReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -195,10 +189,7 @@ class DataStoreConnectionScenario3V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -247,10 +238,7 @@ class DataStoreConnectionScenario3V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -270,10 +258,7 @@ class DataStoreConnectionScenario3V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(post) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) @@ -309,10 +294,7 @@ class DataStoreConnectionScenario3V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) _ = try await Amplify.DataStore.save(comment) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario3aV2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario3aV2Tests.swift index 18fae1693e..fff15cc052 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario3aV2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario3aV2Tests.swift @@ -62,10 +62,7 @@ class DataStoreConnectionScenario3aV2Tests: SyncEngineIntegrationV2TestBase { syncCommentReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) _ = try await Amplify.DataStore.save(comment) @@ -170,10 +167,7 @@ class DataStoreConnectionScenario3aV2Tests: SyncEngineIntegrationV2TestBase { createReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -203,10 +197,7 @@ class DataStoreConnectionScenario3aV2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -230,10 +221,7 @@ class DataStoreConnectionScenario3aV2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + post.title = updatedTitle _ = try await Amplify.DataStore.save(post) @@ -262,10 +250,7 @@ class DataStoreConnectionScenario3aV2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -286,10 +271,7 @@ class DataStoreConnectionScenario3aV2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(post) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) @@ -326,10 +308,7 @@ class DataStoreConnectionScenario3aV2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) _ = try await Amplify.DataStore.save(comment) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -357,10 +336,7 @@ class DataStoreConnectionScenario3aV2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(post) // TODO: Deleting the comment should not be necessary. Cascade delete is not working diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario4V2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario4V2Tests.swift index 0b2c2e9714..2ee916d7ad 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario4V2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario4V2Tests.swift @@ -153,10 +153,7 @@ class DataStoreConnectionScenario4V2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -185,10 +182,7 @@ class DataStoreConnectionScenario4V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -210,10 +204,7 @@ class DataStoreConnectionScenario4V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + post.title = updatedTitle _ = try await Amplify.DataStore.save(post) @@ -242,10 +233,7 @@ class DataStoreConnectionScenario4V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -266,10 +254,7 @@ class DataStoreConnectionScenario4V2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(post) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) } @@ -304,10 +289,7 @@ class DataStoreConnectionScenario4V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) _ = try await Amplify.DataStore.save(comment) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -335,10 +317,7 @@ class DataStoreConnectionScenario4V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(post) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) } diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario5V2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario5V2Tests.swift index 6cafde9e9a..9718d761f5 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario5V2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario5V2Tests.swift @@ -144,10 +144,7 @@ class DataStoreConnectionScenario5V2Tests: SyncEngineIntegrationV2TestBase { createReceived.fulfill() } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -176,10 +173,7 @@ class DataStoreConnectionScenario5V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -228,10 +222,7 @@ class DataStoreConnectionScenario5V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) @@ -252,10 +243,7 @@ class DataStoreConnectionScenario5V2Tests: SyncEngineIntegrationV2TestBase { } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(post) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) } @@ -297,10 +285,7 @@ class DataStoreConnectionScenario5V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) _ = try await Amplify.DataStore.save(user) _ = try await Amplify.DataStore.save(postEditor) @@ -329,10 +314,7 @@ class DataStoreConnectionScenario5V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(post) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) } diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario6V2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario6V2Tests.swift index 6fd35b638c..91ef07ace9 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario6V2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario6V2Tests.swift @@ -193,7 +193,7 @@ class DataStoreConnectionScenario6V2Tests: SyncEngineIntegrationV2TestBase { return } let createReceived = expectation(description: "Create notification received") - let hubListener = Amplify.Hub.listen( + Amplify.Hub.listen( to: .dataStore, eventName: HubPayload.EventName.DataStore.syncReceived) { payload in guard let mutationEvent = payload.data as? MutationEvent @@ -212,18 +212,14 @@ class DataStoreConnectionScenario6V2Tests: SyncEngineIntegrationV2TestBase { return } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } - + let queriedBlogOptional = try await Amplify.DataStore.query(Blog6V2.self, byId: blog.id) guard let queriedBlog = queriedBlogOptional else { XCTFail("Could not get blog") return } XCTAssertEqual(queriedBlog.id, blog.id) - await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) + await fulfillment(of: [createReceived], timeout: 60) } func testSaveBlogPost() async throws { @@ -272,10 +268,7 @@ class DataStoreConnectionScenario6V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + var resultPosts: List? let queriedBlogOptional = try await Amplify.DataStore.query(Blog6V2.self, byId: blog.id) @@ -340,10 +333,7 @@ class DataStoreConnectionScenario6V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + var resultPosts: List? let queriedBlogOptional = try await Amplify.DataStore.query(Blog6V2.self, byId: blog.id) @@ -413,10 +403,7 @@ class DataStoreConnectionScenario6V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let deleteReceived = expectation(description: "Delete notification received") @@ -446,10 +433,7 @@ class DataStoreConnectionScenario6V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(blog) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario7V2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario7V2Tests.swift index 965c4ffe53..5a2fc686c7 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario7V2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario7V2Tests.swift @@ -207,10 +207,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { return } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + let queriedBlogOptional = try await Amplify.DataStore.query(Blog7V2.self, byId: blog.id) guard let queriedBlog = queriedBlogOptional else { XCTFail("Could not get blog") @@ -264,10 +261,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + var resultPosts: List? let queriedBlogOptional = try await Amplify.DataStore.query(Blog7V2.self, byId: blog.id) @@ -331,10 +325,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + var resultPosts: List? let queriedBlogOptional = try await Amplify.DataStore.query(Blog7V2.self, byId: blog.id) @@ -391,10 +382,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let updateReceived = expectation(description: "received updated post from sync event") @@ -416,10 +404,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.save(post) await fulfillment(of: [updateReceived], timeout: TestCommonConstants.networkTimeout) } @@ -449,10 +434,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let deleteReceived = expectation(description: "received deleted post from sync event") @@ -471,10 +453,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(post) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) } @@ -519,10 +498,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let deleteReceived = expectation(description: "received deleted from sync event") @@ -553,10 +529,7 @@ class DataStoreConnectionScenario7V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + _ = try await Amplify.DataStore.delete(blog) await fulfillment(of: [deleteReceived], timeout: TestCommonConstants.networkTimeout) } diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario8V2Tests.swift b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario8V2Tests.swift index 03734fc643..0dcb7a6f85 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario8V2Tests.swift +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/AWSDataStorePluginV2Tests/TransformerV2/DataStoreConnectionScenario8V2Tests.swift @@ -94,10 +94,7 @@ class DataStoreConnectionScenario8V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let queriedAttendeeOptional = try await Amplify.DataStore.query(Attendee8V2.self, byId: attendee.id) @@ -164,10 +161,7 @@ class DataStoreConnectionScenario8V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let updateReceived = expectation(description: "Update notification received") @@ -189,10 +183,7 @@ class DataStoreConnectionScenario8V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + registration.attendee = attendee2 let updatedRegistration = try await Amplify.DataStore.save(registration) @@ -260,10 +251,7 @@ class DataStoreConnectionScenario8V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let deleteRegistrationRecieved = expectation(description: "Delete registration received") @@ -283,10 +271,7 @@ class DataStoreConnectionScenario8V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + let _ = try await Amplify.DataStore.delete(registration) await fulfillment(of: [deleteRegistrationRecieved], timeout: TestCommonConstants.networkTimeout) @@ -351,10 +336,7 @@ class DataStoreConnectionScenario8V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let deleteReceived = expectation(description: "Delete received") @@ -451,10 +433,7 @@ class DataStoreConnectionScenario8V2Tests: SyncEngineIntegrationV2TestBase { } } } - guard try await HubListenerTestUtilities.waitForListener(with: hubListener, timeout: 5.0) else { - XCTFail("Listener not registered for hub") - return - } + await fulfillment(of: [createReceived], timeout: TestCommonConstants.networkTimeout) let deleteReceived = expectation(description: "Delete received") diff --git a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/DataStoreHostApp.xcodeproj/xcshareddata/xcschemes/DataStoreHostApp.xcscheme b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/DataStoreHostApp.xcodeproj/xcshareddata/xcschemes/DataStoreHostApp.xcscheme index b328a610c2..e432a36b37 100644 --- a/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/DataStoreHostApp.xcodeproj/xcshareddata/xcschemes/DataStoreHostApp.xcscheme +++ b/AmplifyPlugins/DataStore/Tests/DataStoreHostApp/DataStoreHostApp.xcodeproj/xcshareddata/xcschemes/DataStoreHostApp.xcscheme @@ -29,24 +29,72 @@ shouldUseLaunchSchemeArgsEnv = "YES"> + skipped = "NO"> + skipped = "NO"> + + + + + + + + + + + + + + + + + + + +