                .bind(host: "127.0.0.1", port: 0)
                .wait())

            // Make a client socket to mess with the server. Setting SO_LINGER forces RST instead of FIN.
            let clientSocket = try assertNoThrowWithValue(Socket(protocolFamily: AF_INET, type: Posix.SOCK_STREAM))
            XCTAssertNoThrow(try clientSocket.setOption(level: SOL_SOCKET, name: SO_LINGER, value: linger(l_onoff: 1, l_linger: 0)))
            XCTAssertNoThrow(try clientSocket.connect(to: serverChannel.localAddress!))
            XCTAssertNoThrow(try clientSocket.close())
        
            // Trigger accept() in the server
            serverChannel.read()
        
            // Wait for the server to have something
            let result = try assertNoThrowWithValue(serverPromise.futureResult.wait())