aws-amplify / amplify-android

The fastest and easiest way to use AWS from your Android app.
https://docs.amplify.aws/lib/q/platform/android/
Apache License 2.0
249 stars 117 forks source link

chore(auth): Add waits to asynchronous tests #2924

Closed mattcreaser closed 2 months ago

mattcreaser commented 2 months ago

Issue #, if available:

Description of changes: I noticed that unit tests in RealAuthCognitoPluginTest were frequently failing on CI. Inspecting the failing tests show that they were not necessarily waiting for the callbacks to be invoked before proceeding with verification. Adding additional latches should resolve the issue.

Longer term this area of the codebase should be refactored into usecases.

How did you test these changes? (Please add a line here how the changes were tested)

Documentation update required?

General Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.