From 0c6ec05c6b5699847ddc83cfd9d9e48f5e17c99e Mon Sep 17 00:00:00 2001 From: Jordan Nelson Date: Thu, 14 Sep 2023 14:29:28 -0400 Subject: [PATCH] chore: remove delay to start datastore in tests (#3738) chore: remove start delay is datastore tests --- .../amplify_datastore/example/integration_test/clear_test.dart | 2 +- .../example/integration_test/utils/setup_utils.dart | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/amplify_datastore/example/integration_test/clear_test.dart b/packages/amplify_datastore/example/integration_test/clear_test.dart index 90a85ad2d1..8239ee36fb 100644 --- a/packages/amplify_datastore/example/integration_test/clear_test.dart +++ b/packages/amplify_datastore/example/integration_test/clear_test.dart @@ -22,7 +22,7 @@ void main() { await Amplify.DataStore.save(blog); var resultOne = await Amplify.DataStore.query(Blog.classType); expect(resultOne, isNotEmpty); - await Amplify.DataStore.clear(); + await clearDataStore(); var resultTwo = await Amplify.DataStore.query(Blog.classType); expect(resultTwo, isEmpty); }); diff --git a/packages/amplify_datastore/example/integration_test/utils/setup_utils.dart b/packages/amplify_datastore/example/integration_test/utils/setup_utils.dart index 0245023a85..54de45602d 100644 --- a/packages/amplify_datastore/example/integration_test/utils/setup_utils.dart +++ b/packages/amplify_datastore/example/integration_test/utils/setup_utils.dart @@ -12,7 +12,6 @@ import 'package:amplify_flutter/amplify_flutter.dart'; const ENABLE_CLOUD_SYNC = bool.fromEnvironment('ENABLE_CLOUD_SYNC', defaultValue: false); const DATASTORE_READY_EVENT_TIMEOUT = const Duration(minutes: 10); -const DELAY_TO_START_DATASTORE = const Duration(milliseconds: 500); const DELAY_TO_CLEAR_DATASTORE = const Duration(seconds: 2); const DELAY_FOR_OBSERVE = const Duration(milliseconds: 100); @@ -106,7 +105,6 @@ class DataStoreStarter { } Future startDataStore() async { - await Future.delayed(DELAY_TO_START_DATASTORE); await DataStoreStarter().startDataStore(); }