Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around Travis-CI IPv6 failures. #1970

Merged
merged 2 commits into from
Nov 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/vibe.http.server.1388/dub.sdl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name "tests"
description "IPv6 request"
dependency "vibe-d:http" path="../../"
versions "VibeDefaultMain"
8 changes: 7 additions & 1 deletion tests/vibe.http.server.1388/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import vibe.stream.operations;
import core.time : msecs;
import std.datetime : Clock, UTC;

shared static this()
void main()
{
version (none) {
auto s1 = new HTTPServerSettings;
s1.bindAddresses = ["::1"];
s1.port = 11388;
Expand All @@ -30,6 +31,11 @@ shared static this()

exitEventLoop();
});
runApplication();
}

import vibe.core.log : logWarn;
logWarn("Test disabled due to issues listening on ::1 on Travis-CI");
}

void handler(scope HTTPServerRequest req, scope HTTPServerResponse res)
Expand Down
4 changes: 2 additions & 2 deletions tests/vibe.http.server.1721/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ shared static this()
{
auto s1 = new HTTPServerSettings;
s1.options &= ~HTTPServerOption.errorStackTraces;
s1.bindAddresses = ["::1"];
s1.bindAddresses = ["127.0.0.1"];
s1.port = 11721;
listenHTTP(s1, &handler);

runTask({
scope (exit) exitEventLoop();

try {
auto conn = connectTCP("::1", 11721);
auto conn = connectTCP("127.0.0.1", 11721);
conn.write("GET / HTTP/1.0\r\n\r\n");
string res = cast(string)conn.readLine();
assert(res == "HTTP/1.0 200 OK", res);
Expand Down
8 changes: 4 additions & 4 deletions tests/vibe.http.server.host-header/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ shared static this()
{
auto s1 = new HTTPServerSettings;
s1.options &= ~HTTPServerOption.errorStackTraces;
s1.bindAddresses = ["::1"];
s1.bindAddresses = ["127.0.0.1"];
s1.port = 11388;
listenHTTP(s1, &handler);

runTask({
try {
auto conn = connectTCP("::1", 11388);
conn.write("GET / HTTP/1.1\r\nHost: [::1]\r\n\r\n");
auto conn = connectTCP("127.0.0.1", 11388);
conn.write("GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n");
string res = cast(string)conn.readLine();
assert(res == "HTTP/1.1 200 OK", res);
while (conn.readLine().length > 0) {}
Expand All @@ -37,7 +37,7 @@ shared static this()
assert(!conn.connected);
logInfo("1.1 without Host header OK.");

conn = connectTCP("::1", 11388);
conn = connectTCP("127.0.0.1", 11388);
conn.write("GET / HTTP/1.0\r\n\r\n");
res = cast(string)conn.readLine();
assert(res == "HTTP/1.0 200 OK", res);
Expand Down