If I'm reading the code right, this test depends on connect not failing during the connect and only later failing during the poll. It's not wrong for connect to fail immediately and not defer that to a poll, even with the socket set to non-blocking. I've seen it on linux and on freebsd/64 it seems to occur pretty frequently (roughly half the time).
I'm tempted to just nuke the entire test. It's not a dmd test, it's a phobos test, and all that code is on the list of 'things that should be overhauled' anyway.
Comment #1 by braddr — 2011-06-12T11:41:52Z
After a little research, trying to find where the test came from, I found that my past has come back to haunt me. The test came from the reporter of bug 268, which I fixed. The fix back then wasn't wrong and was unrelated to this problem.