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

t\spec\S32-io\IO-Socket-INET.t hangs on Windows #6094

Open
p6rt opened this issue Mar 1, 2017 · 6 comments
Open

t\spec\S32-io\IO-Socket-INET.t hangs on Windows #6094

p6rt opened this issue Mar 1, 2017 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 1, 2017

Migrated from rt.perl.org#130892 (status was 'open')

Searchable as RT130892$

@p6rt
Copy link
Author

p6rt commented Mar 1, 2017

From @nanis

When running `nmake spectest` with a development snapshot build of
MoarVM, NQP, and Rakudo, I noticed that the socket test is hanging​:

t\spec\S32-io\IO-Socket-INET.t .................................... 49/51

I have to manually kill the moarvm.exe instance running this
particular test to let `nmake spectest` continue.

Running with higher verbosity gives me the following output *after* I
terminate the process running the test from the Task Manager​:

D​:\Src\perl6\rakudo> perl t\harness5 --verbosity=5
t\spec\S32-io\IO-Socket-INET.t
t\spec\S32-io\IO-Socket-INET.t ..
1..51
# [0s] starting tests
# [0s] Testing on port 1024
ok 1 - [2s] echo server and client
ok 2 - finished in time \#​1
ok 3 - [1s] discard server and client
ok 4 - finished in time \#​2
ok 5 - [2s] received first 7 characters
ok 6 - finished in time \#​3
ok 7 - [0s] received next 3 characters
ok 8 - finished in time \#​4
ok 9 - [0s] remaining 26 were buffered
ok 10 - finished in time \#​5
ok 11 - [0s] received ꀁ
ok 12 - finished in time \#​6
ok 13 - [0s] ... which is 1 character
ok 14 - finished in time \#​7
ok 15 - [0s] received another character
ok 16 - finished in time \#​8
ok 17 - [0s] combined the bytes form ꀂ
ok 18 - finished in time \#​9
ok 19 - [2s] get() with default separator
ok 20 - finished in time \#​10
ok 21 - [0s] default separator
ok 22 - finished in time \#​11
ok 23 - [0s] \r\n separator
ok 24 - [0s] \r was not left behind on the string
ok 25 - finished in time \#​12
ok 26 - [0s] . as a separator
ok 27 - finished in time \#​13
ok 28 - [0s] ! separator not at end of string
ok 29 - finished in time \#​14
ok 30 - [0s] Multiple separators not at end of string
ok 31 - finished in time \#​15
ok 32 - [0s] ! separator at end of string
ok 33 - [5s] received first character
ok 34 - finished in time \#​16
ok 35 - [0s] received last character
ok 36 - finished in time \#​17
ok 37 - [0s] total amount
ok 38 - finished in time \#​18
ok 39 - [1s] successful read binary data
ok 40 - finished in time \#​19
ok 41 - [2s] successful received binary data
ok 42 - finished in time \#​20
ok 43 - [2s] received first character
ok 44 - finished in time \#​21
ok 45 - [0s] received last character
ok 46 - finished in time \#​22
ok 47 - [0s] total amount
ok 48 - finished in time \#​23
ok 49 - [2s] echo server and client
ok 50 - finished in time \#​1
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/51 subtests

Test Summary Report


t\spec\S32-io\IO-Socket-INET.t (Wstat​: 256 Tests​: 50 Failed​: 0)
  Non-zero exit status​: 1
  Parse errors​: Bad plan. You planned 51 tests but ran 50.
Files=1, Tests=50, 179 wallclock secs ( 0.08 usr + 0.01 sys = 0.09 CPU)
Result​: FAIL

@p6rt
Copy link
Author

p6rt commented Mar 1, 2017

From @zoffixznet

Hi, would you please include the version you're using?. You can get it by running `perl6 -v`

@p6rt
Copy link
Author

p6rt commented Mar 1, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 1, 2017

From @nanis

I have observed this before (including with the 2017.01 release), but
most recently today after building from a fresh pull.

$ perl6 -v
This is Rakudo version 2017.02-140-gdd1dab2 built on MoarVM version
2017.02-20-g773711e
implementing Perl 6.c.

$ nqp -v
This is nqp version 2017.02-39-g2780ed7 built on MoarVM version
2017.02-20-g773711e

On Wed, Mar 1, 2017 at 5​:04 PM, Zoffix Znet via RT
<perl6-bugs-followup@​perl.org> wrote​:

Hi, would you please include the version you're using?. You can get it by running `perl6 -v`

@p6rt
Copy link
Author

p6rt commented Mar 4, 2018

From @ronaldxs

From your description of running the test with nmake I find it reasonable to assume you are testing on windows. Winsock seems to have a 1 second delay for “connection refused” errors which is triggered (2000 times) by a test added with PR 227​: Raku/roast#227. I saw some documentation of the delay on msdn (https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9b90b65c-4630-46b1-98f1-5d4d22427962/delayed-connection-refused-error?forum=netfxnetcom ) and is demonstrated by a small Perl 5 script below. The problem also effects roast on WSL (windows subsystem for linux).

# test below runs in about 10 seconds on windows/WSL
# and instantly on linux

use Socket; # This defines PF_INET and SOCK_STREAM

for (1..10) {
  socket my $socket,PF_INET,SOCK_STREAM,(getprotobyname('tcp'))[2];
  connect $socket, sockaddr_in(1, inet_aton('127.0.0.1'))
  or $! =~ /\bconnection\b.*\brefused\b/i
  or die "can't connect​: $!\n";
  close($socket);
}

@p6rt
Copy link
Author

p6rt commented Mar 7, 2018

From @zoffixznet

A Windows-specific skip-fudge now went in[^1] but the problem remains

[1] Raku/roast@86abb53

@p6rt p6rt added the Windows label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant