Skip to content

Commit

Permalink
Attempt to sidestep bogus test hang failures.
Browse files Browse the repository at this point in the history
- Delays the write operation slightly to avoid delaying the connection establishment
- Extends the watchdog timeout to 2 seconds
  • Loading branch information
s-ludwig committed May 14, 2017
1 parent 0372a8f commit 2dc384e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/vibe.core.net.1726/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ shared static this()
} // expected
}, conn);
auto wt = runTask!TCPConnection((conn) {
sleep(1.msecs); // give the connection time to establish
try {
conn.write(buf);
assert(false, "Expected read() to throw an exception.");
Expand All @@ -37,16 +38,17 @@ shared static this()
assert(read_ex, "No read exception thrown");
assert(write_ex, "No write exception thrown");
exitEventLoop();
});
}, "127.0.0.1");

runTask({
try {
auto conn = connectTCP("127.0.0.1", 11375);
sleep(10.msecs);
conn.close();
} catch (Exception e) assert(false, e.msg);
});

setTimer(1000.msecs, {
setTimer(2000.msecs, {
assert(false, "Test has hung.");
});
}

0 comments on commit 2dc384e

Please sign in to comment.