             XCTAssert(peripheralManager.isAdvertising, "isAdvertising invalid value")
         }
         future.onFailure { error in
+            expectation.fulfill()
             XCTFail("onFailure called")
         }
         peripheralManager.didStartAdvertising(nil)

        let expectation = expectationWithDescription("onFailure fulfilled for future")
        let future = peripheralManager.startAdvertising(self.peripheralName, uuids:[self.advertisedUUIDs])
        future.onSuccess {
            XCTFail("onSuccess called")
        }
        future.onFailure {error in

            XCTAssertEqual(peripheralServices.count, 0, "peripheralManager service count invalid")
        }
        addServicesFuture.onFailure {error in
            expectation.fulfill()
            XCTFail("onFailure called")
        }
        waitForExpectationsWithTimeout(2) {error in
