             expectation.fulfill()
         }
         future.onFailure {error in
+            expectation.fulfill()
             XCTFail("onFailure called")
         }
         mock.state = .PoweredOn

            }
        }
        future.onFailure {error in
            XCTFail("onFailure called")
        }
        peripheralManager.didStartAdvertising(nil)

            XCTAssert(peripheralServices.contains(services[1].UUID), "addedService has invalid UUID")
        }
        future.onFailure {error in
            expectation.fulfill()
            XCTFail("onFailure called")
        }
        waitForExpectationsWithTimeout(2) {error in
