Issue #, if available:
Recent changes for Cognito pipeline reported test failures.
Description of changes:
Fixed the following tests for failures:
Amazon.Extensions.CognitoAuthentication.IntegrationTests.MfaAuthenticationTests.TestMfaAuthenticationFlow: Sometimes, the user pool creation was giving Role does not have permission to publish with SNS exception. This needs to be included in buffer exceptions.
CognitoAuthentication.IntegrationTests.NET45.CognitoCredentialsTests.TestGetCognitoAWSCredentials: Intermittent issue fixed by increasing the timeout. Also, the test was not able to cleanup resources due to use of await and not waiting for cleanup to complete. As a result of this, there were left over user pools, roles and identity pools. Fixed the cleanup process to wait for cleanup operation to complete.
NOTE: Switching await DoThingAsync() to DoThingAsync().Wait() is usually a very bad idea. However, in current scenario, since the test process exits, awaiting is aborted and resources are not cleaned up. Refer the other test case Amazon.Extensions.CognitoAuthentication.IntegrationTests.MfaAuthenticationTests.TestMfaAuthenticationFlow, it Wait(s). Also, the resources have to be cleaned up in specific order and awaiting normally might not guarantee the order in which the API calls would be executed.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: Recent changes for Cognito pipeline reported test failures.
Description of changes: Fixed the following tests for failures:
Role does not have permission to publish with SNS
exception. This needs to be included in buffer exceptions.await
and not waiting for cleanup to complete. As a result of this, there were left over user pools, roles and identity pools. Fixed the cleanup process to wait for cleanup operation to complete.NOTE: Switching
await DoThingAsync()
toDoThingAsync().Wait()
is usually a very bad idea. However, in current scenario, since the test process exits, awaiting is aborted and resources are not cleaned up. Refer the other test caseAmazon.Extensions.CognitoAuthentication.IntegrationTests.MfaAuthenticationTests.TestMfaAuthenticationFlow
, it Wait(s). Also, the resources have to be cleaned up in specific order and awaiting normally might not guarantee the order in which the API calls would be executed.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.