             XCTAssertEqual(qos_class_self(), QOS_CLASS_USER_INTERACTIVE, "On \(qos_class_self().description) (expected \(QOS_CLASS_USER_INTERACTIVE.description))")
             expectation.fulfill()
         }
-        waitForExpectationsWithTimeout(1, handler: nil)
+        waitForExpectationsWithTimeout(timeMargin, handler: nil)
     }
 
     func testAsyncUserInitiated() {

            XCTAssert(wasInBackground, "Was in background first")
            expectation.fulfill()
        }
        waitForExpectationsWithTimeout(1, handler: nil)
    }

    func testChaining() {
        let expectation = expectationWithDescription("Expected On \(qos_class_self().description) (expected \(QOS_CLASS_USER_INTERACTIVE.description))")
        var id = 0
        Async.main {
            XCTAssertEqual(qos_class_self(), qos_class_main(), "On \(qos_class_self().description) (expected \(qos_class_main().description))")
            XCTAssertEqual(++id, 1, "Count main queue")
        }.userInteractive {
            XCTAssertEqual(qos_class_self(), QOS_CLASS_USER_INTERACTIVE, "On \(qos_class_self().description) (expected \(QOS_CLASS_USER_INTERACTIVE.description))")

    func testWait() {
        var id = 0
        let block = Async.background {
            // Some work
            NSThread.sleepForTimeInterval(0.1)
            XCTAssertEqual(++id, 1, "")
        }
        XCTAssertEqual(id, 0, "")
