         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)]))
+            "modified": Double(NSDate.now())/1000]))
         server.storeRecords([envelope], inCollection: "meta")
     }
 

        // To recover from a meta/global version "in the past", fresh start.
        storeMetaGlobal(MetaGlobal(syncID: "id", storageVersion: 4, engines: [String: EngineMeta](), declined: []))

        let afterStores = now()
        let expectation = expectationWithDescription("Waiting on value.")
        stateMachine.toReady(authState).upon { result in
            XCTAssertEqual(self.stateMachine.stateLabelSequence.map { $0.rawValue }, ["initialWithLiveToken", "initialWithLiveTokenAndInfo", "resolveMetaGlobalVersion", "remoteUpgradeRequired",

            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()
