             }
 
             afterEach {
-                A0SimpleKeychain().clearAll()
+                _ = credentialsManager.clear()
             }
 
             it("should error when no credentials stored") {
-                A0SimpleKeychain().clearAll()
-                credentialsManager.credentials { result in
-                    expect(result).to(haveCredentialsManagerError(CredentialsManagerError(code: .noCredentials)))
+                _ = credentialsManager.clear()
+
+                waitUntil(timeout: Timeout) { done in
+                    credentialsManager.credentials { result in
+                        expect(result).to(haveCredentialsManagerError(CredentialsManagerError(code: .noCredentials)))
+                        done()
+                    }
                 }
             }
 
             it("should error when no refresh token") {
                 credentials = Credentials(accessToken: AccessToken, tokenType: TokenType, idToken: IdToken, refreshToken: nil, expiresIn: Date(timeIntervalSinceNow: -ExpiresIn))
                 _ = credentialsManager.store(credentials: credentials)
-                credentialsManager.credentials { result in
-                    expect(result).to(haveCredentialsManagerError(CredentialsManagerError(code: .noRefreshToken)))
+
+                waitUntil(timeout: Timeout) { done in
+                    credentialsManager.credentials { result in
+                        expect(result).to(haveCredentialsManagerError(CredentialsManagerError(code: .noRefreshToken)))
+                        done()
+                    }
                 }
             }
 
             it("should return original credentials as not expired") {
                 _ = credentialsManager.store(credentials: credentials)
-                credentialsManager.credentials { result in
-                    expect(result).to(haveCredentials())
+
+                waitUntil(timeout: Timeout) { done in
+                    credentialsManager.credentials { result in
+                        expect(result).to(haveCredentials())
+                        done()
+                    }
                 }
             }
 


            context("serial renew from same thread") {

                it("should not renew the credentials after the previous renewal operation succeeded") {
                    credentials = Credentials(accessToken: AccessToken, tokenType: TokenType, idToken: IdToken, refreshToken: RefreshToken, expiresIn: Date(timeIntervalSinceNow: -ExpiresIn))
                    _ = credentialsManager.store(credentials: credentials)
                    stub(condition: isToken(Domain) && hasAtLeast(["refresh_token": RefreshToken])) { _ in
                        return authResponse(accessToken: NewAccessToken, idToken: NewIdToken, refreshToken: NewRefreshToken, expiresIn: ExpiresIn)
                    }
                    waitUntil(timeout: Timeout) { done in
                        credentialsManager.credentials { result in
                            expect(result).to(haveCredentials())
                        }
                        credentialsManager.credentials { result in
                            expect(result).to(beSuccessful())
                            done()
                        }
                    }
                }

                it("should yield the stored credentials after the previous renewal operation succeeded") {
                    credentials = Credentials(accessToken: AccessToken, tokenType: TokenType, idToken: IdToken, refreshToken: RefreshToken, expiresIn: Date(timeIntervalSinceNow: -ExpiresIn))
                    _ = credentialsManager.store(credentials: credentials)

            }

            context("serial renew from different threads") {

                it("should yield the stored credentials after the previous renewal operation succeeded") {
                    credentials = Credentials(accessToken: AccessToken, tokenType: TokenType, idToken: IdToken, refreshToken: RefreshToken, expiresIn: Date(timeIntervalSinceNow: -ExpiresIn))
