From baa4c5e3f97d168ff409657bc51a31efab119edc Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Tue, 5 Sep 2023 08:24:18 -0700 Subject: [PATCH] ci(auth): Prevent eventual consistency issues --- .../lib/src/commands/generate/generate_workflows_command.dart | 1 + .../auth_cognito/integration_test_auth_utils.dart | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/aft/lib/src/commands/generate/generate_workflows_command.dart b/packages/aft/lib/src/commands/generate/generate_workflows_command.dart index aabceda218..b068dfa687 100644 --- a/packages/aft/lib/src/commands/generate/generate_workflows_command.dart +++ b/packages/aft/lib/src/commands/generate/generate_workflows_command.dart @@ -320,6 +320,7 @@ jobs: await generateForPackage( examplePackage, repoRelativePath: p.relative(examplePackage.path, from: rootDir.path), + // TODO(dnys1): Add example's dependency graph dependentPackages: [ ...dependentPackages, package, diff --git a/packages/test/amplify_integration_test/lib/src/integration_test_utils/auth_cognito/integration_test_auth_utils.dart b/packages/test/amplify_integration_test/lib/src/integration_test_utils/auth_cognito/integration_test_auth_utils.dart index 7327202059..a0bf3773c0 100644 --- a/packages/test/amplify_integration_test/lib/src/integration_test_utils/auth_cognito/integration_test_auth_utils.dart +++ b/packages/test/amplify_integration_test/lib/src/integration_test_utils/auth_cognito/integration_test_auth_utils.dart @@ -262,6 +262,10 @@ Future adminCreateUser( _logger.debug('Successfully created user "$username"'); + // Prevent eventual consistency issues caused by authenticating a user + // too quickly after creation. + await Future.delayed(const Duration(milliseconds: 500)); + return cognitoUsername; }