             _ = try! socket.write(data)
         }
         write.resume()
-
-        let group = DispatchGroup()
-        group.enter()
+        
+        let promise = Promise<Void>()
 
 
         let read = DispatchSource.makeReadSource(fileDescriptor: socket.descriptor, queue: queue)

import Dispatch
import TCP
import XCTest

            _ = try! client.write(data)
        }

        try promise.future.blockingAwait(timeout: .seconds(3))
    }

    static let allTests = [
