 
     func testMetaGlobalMissing() {
         // To recover from a missing meta/global, fresh start.
-        let afterStores = now()
+        let afterStores = NSDate.now()
         let expectation = expectationWithDescription("Waiting on value.")
         stateMachine.toReady(authState).upon { result in
             XCTAssertEqual(self.stateMachine.stateLabelSequence.map { $0.rawValue }, ["initialWithLiveToken", "initialWithLiveTokenAndInfo", "missingMetaGlobal",

        stateMachine = SyncStateMachine(prefs: syncPrefs)
    }

    func now() -> Timestamp {
        return Timestamp(1000 * NSDate().timeIntervalSince1970)
    }

    func storeMetaGlobal(metaGlobal: MetaGlobal) {
        let envelope = EnvelopeJSON(JSON([
            "id": "global",
            "collection": "meta",
            "payload": metaGlobal.asPayload().toString(),
            "modified": Double(NSDate().timeIntervalSince1970)]))
        server.storeRecords([envelope], inCollection: "meta")
    }


            XCTAssertNil(error, "\(error)")
        }

        let afterSecondSync = NSDate.now()

        // Store a fresh crypto/keys, with a changed default key and one identical collection key, and one changed collection key.
        let freshCryptoKeys2 = Keys.random()
