diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97a2630..d0d749d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,6 +90,7 @@ jobs: compiler: ${{ matrix.dc }} - name: '[POSIX] Run tests' + shell: bash env: PARTS: ${{ matrix.parts }} run: | diff --git a/tests/vibe.http.client.1389/source/app.d b/tests/vibe.http.client.1389/source/app.d index a506055..761983e 100644 --- a/tests/vibe.http.client.1389/source/app.d +++ b/tests/vibe.http.client.1389/source/app.d @@ -30,10 +30,15 @@ shared static this() auto url = "http://"~serverAddr.toString; logInfo(url); - auto cs = new HTTPClientSettings; - cs.networkInterface = resolveHost("127.0.0.1"); - auto res = requestHTTP(url, null, cs).bodyReader.readAllUTF8(); - assert(res == "local", "Unexpected reply: "~res); + string res; + + version (Windows) {} + else { + auto cs = new HTTPClientSettings; + cs.networkInterface = resolveHost("127.0.0.1"); + res = requestHTTP(url, null, cs).bodyReader.readAllUTF8(); + assert(res == "local", "Unexpected reply: "~res); + } auto cs2 = new HTTPClientSettings; cs2.networkInterface = resolveHost(externalAddr.toAddressString()); diff --git a/tests/vibe.http.client.1426/source/app.d b/tests/vibe.http.client.1426/source/app.d index bfb1072..6b50478 100644 --- a/tests/vibe.http.client.1426/source/app.d +++ b/tests/vibe.http.client.1426/source/app.d @@ -9,8 +9,11 @@ extern(C) __gshared string[] rt_options = [ "gcopt=parallel:0" ]; int main () { immutable serverAddr = listenTCP(0, (TCPConnection c) @safe nothrow { - try c.write("HTTP/1.1 200 OK\r\nConnection: Close\r\n\r\nqwerty"); - catch (Exception e) assert(0, e.msg); + try { + // skip request + c.readUntil(cast(immutable(ubyte)[])"\r\n\r\n"); + c.write("HTTP/1.1 200 OK\r\nConnection: Close\r\n\r\nqwerty"); + } catch (Exception e) assert(0, e.msg); }, "127.0.0.1").bindAddress; runTask({ diff --git a/tests/vibe.http.server.listenHTTP/source/app.d b/tests/vibe.http.server.listenHTTP/source/app.d index 32bfc39..0bdbd71 100644 --- a/tests/vibe.http.server.listenHTTP/source/app.d +++ b/tests/vibe.http.server.listenHTTP/source/app.d @@ -9,9 +9,11 @@ import std.socket : AddressFamily; shared static this() { - immutable serverAddr = listenHTTP(":0", (scope req, scope res) { + immutable serverPort = listenHTTP(":0", (scope req, scope res) { res.writeBody("Hello world."); - }).bindAddresses.find!(addr => addr.family == AddressFamily.INET).front; + }).bindAddresses.find!(addr => addr.family == AddressFamily.INET).front.port; + auto serverAddr = resolveHost("127.0.0.1"); + serverAddr.port = serverPort; runTask({ scope (exit) exitEventLoop();