 		migrationOperation.destinationStoreType = storeType
 		migrationOperation.destinationModel = latestModel
 		migrationOperation.bundles = [testBundle]
+		migrationOperation.completionBlock = {
+			XCTAssertNil(migrationOperation.error, "Migration operation failed: \(migrationOperation.error)")
+			operationExpectation.fulfill()
+		}
 		operationQueue.addOperation(migrationOperation)
-		operationQueue.waitUntilAllOperationsAreFinished()
-		XCTAssertNil(migrationOperation.error, "Migration operation failed: \(migrationOperation.error)")
-		
-		let persistentStoreCoordinator = NSPersistentStoreCoordinator(managedObjectModel: latestModel)
-		do {
-			try persistentStoreCoordinator.addPersistentStoreWithType(storeType, configuration: nil, URL: storeURL, options: nil)
-		} catch {
-			XCTFail("Could not load persistent store after migration: \(error)")
-			return
+		waitForExpectationsWithTimeout(10) { error in
+			if error != nil {
+				return
+			}
+			let persistentStoreCoordinator = NSPersistentStoreCoordinator(managedObjectModel: latestModel)
+			do {
+				try persistentStoreCoordinator.addPersistentStoreWithType(self.storeType, configuration: nil, URL: storeURL, options: nil)
+			} catch {
+				XCTFail("Could not load persistent store after migration: \(error)")
+				return
+			}
 		}
 	}
 	

    
    override func setUp() {
        super.setUp()
		
		testBundle = NSBundle(forClass: self.dynamicType)
		
		let modelVersions = 1...3
		for versionNumber in modelVersions {
			let modelURL: NSURL! = testBundle.URLForResource("TestModelV\(versionNumber)", withExtension: "mom")
			XCTAssertNotNil(modelURL, "Could not locate V\(versionNumber) test model.")
			let model: NSManagedObjectModel! = NSManagedObjectModel(contentsOfURL: modelURL)

		let existingStoreMetadata: [String: AnyObject]
		do {
			existingStoreMetadata = try NSPersistentStoreCoordinator.metadataForPersistentStoreOfType(storeType, URL: storeURL)
			XCTFail("Retrieving store metadata for nonexistant store succeeded: \(existingStoreMetadata)")
		} catch {
			existingStoreMetadata = [:]
		}
		do {
			let migrationPlan = try MigrationPlan(storeMetadata: existingStoreMetadata, destinationModel: latestModel, bundles: [testBundle])
			XCTFail("Devising migration plan for nonexistant store succeeded: \(migrationPlan)")
		} catch {}
	}
}
