     func assertNoPurchases(_ customerInfo: CustomerInfo?) {
         expect(customerInfo?.entitlements.all.count) == 0
     }
+
+    func waitUntilCustomerInfoIsUpdated() {
+        expect(self.purchasesDelegate.customerInfoUpdateCount).toEventually(equal(1), timeout: .seconds(10))
+    }
     
 }

    func testPurchaseMadeBeforeLogInWithExistingUserIsNotRetainedUnlessRestoreCalled() {
        var completionCalled = false
        let existingUserID = "\(#function)\(UUID().uuidString)"
        expect(self.purchasesDelegate.customerInfoUpdateCount).toEventually(equal(1), timeout: .seconds(10))

        // log in to create the user, then log out
        Purchases.shared.logIn(existingUserID) { logInCustomerInfo, created, logInError in

    func testPurchaseAsIdentifiedThenLogOutThenRestoreGrantsEntitlements() {
        var completionCalled = false
        let existingUserID = UUID().uuidString
        self.waitUntilCustomerInfoIsUpdated()

        Purchases.shared.logIn(existingUserID) { logInCustomerInfo, created, logInError in
            self.purchaseMonthlyOffering()
