How come unittesting std.socket takes 46 seconds?

Vladimir Panteleev thecybershadow.lists at gmail.com
Sat May 1 18:24:06 UTC 2021


On Saturday, 1 May 2021 at 18:14:33 UTC, Andrei Alexandrescu 
wrote:
> A special dedicated test mode should be for that.

There already is something like that: `debug=std_socket` (and 
used via `softUnittest`).

> Routine unittests should not connect to the network.

Currently, an absence of Internet connection (without 
`debug=std_socket`) will not cause a failure.

However, the absence of an Internet connection should still not 
result in a very long test duration. I don't know for sure what 
causes this in your case. My first guess would be that the 
computer thinks it's connected to the Internet whereas it 
actually has no connectivity (e.g. it's connected to a network 
which advertises a gateway but all packets sent to it are 
actually dropped).

BTW, if this is still in WSL, I think that should be mentioned 
explicitly. I don't think we currently officially support that 
environment, and I'm not sure if we should expend much effort in 
doing so, considering that it's occasionally buggy and rapidly 
evolving. (I got bug reports that turned out to be due to 
filesystems in WSL behaving mysteriously and incorrectly, e.g. 
inability to rename a directory even with no processes accessing 
it.)



More information about the Digitalmars-d mailing list