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

Failed test 'WebSocket closed with status 1009' #1133

Closed
Astara opened this issue Oct 1, 2017 · 6 comments
Closed

Failed test 'WebSocket closed with status 1009' #1133

Astara opened this issue Oct 1, 2017 · 6 comments

Comments

@Astara
Copy link

Astara commented Oct 1, 2017

  • Mojolicious version: 7.46-1
  • Perl version: 5.22
  • Operating system: Windows 7SP1 x64 cygwin
    CYGWIN_NT-6.1 Athenae 2.8.2(0.313/5/3) 2017-07-12 10:58 x86_64 Cygwin

Steps to reproduce the behavior

Tried to install latest Mojolicious version:

>  cpan -i Mojolicious
CPAN::SQLite not installed, trying to work without
CPAN: Storable loaded ok (v2.53_02)
Reading '/var/cache/CPAN/Metadata'
  Database was generated on Fri, 29 Sep 2017 09:29:02 GMT
Running install for module 'Mojolicious'
CPAN: Digest::SHA loaded ok (v5.96)
CPAN: Compress::Zlib loaded ok (v2.074)
Checksum for /Share/CPAN/sources/authors/id/S/SR/SRI/Mojolicious-7.46.tar.gz ok
CPAN: YAML loaded ok (v1.23)
CPAN: CPAN::Meta::Requirements loaded ok (v2.132)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::CoreList loaded ok (v5.20170715_22)
Configuring S/SR/SRI/Mojolicious-7.46.tar.gz with Makefile.PL
CPAN: CPAN::Reporter loaded ok (v1.2018)
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Mojolicious
Writing MYMETA.yml and MYMETA.json
(/usr/bin/perl Makefile.PL exited with 0)
CPAN::Reporter: Makefile.PL result is 'pass', No errors.
  SRI/Mojolicious-7.46.tar.gz
  /usr/bin/perl Makefile.PL -- OK
...
Manifying 3 pod documents
Manifying 118 pod documents
(make.exe -j 6 -j 6 exited with 0)
CPAN::Reporter: make result is 'pass', No errors.
  SRI/Mojolicious-7.46.tar.gz
  make.exe -j 6 -j 6 -- OK
Running make test
PERL_DL_NONLAZY=1 "/usr/bin/perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/*/*.t
...
t/mojolicious/testing_app.t ................ ok
t/mojolicious/tls_lite_app.t ............... skipped: set TEST_TLS to enable this test (developer only!)
t/mojolicious/twinkle_lite_app.t ........... ok
t/mojolicious/types.t ...................... ok
t/mojolicious/upload_lite_app.t ............ ok
t/mojolicious/upload_stream_lite_app.t ..... ok
t/mojolicious/validation_lite_app.t ........ ok
Use of uninitialized value in numeric ge (>=) at /var/cache/CPAN/build/Mojolicious-7.46-0/blib/lib/Mojo/Server/Daemon.pm line 109.
# WebSocket closed with status 1006

#   Failed test 'WebSocket closed with status 1009'
#   at t/mojolicious/websocket_lite_app.t line 163.
Use of uninitialized value $loop in hash element at /var/cache/CPAN/build/Mojolicious-7.46-0/blib/lib/Mojo/UserAgent.pm line 200.
Mojo::Reactor::Poll: I/O watcher failed: Can't call method "remove" on an undefined value at /var/cache/CPAN/build/Mojolicious-7.46-0/blib/lib/Mojo/UserAgent.pm line 276.
# Looks like you failed 1 test of 291.
t/mojolicious/websocket_lite_app.t ......... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/291 subtests 
t/pod.t .................................... skipped: set TEST_POD to enable this test (developer only!)
t/pod_coverage.t ........................... skipped: set TEST_POD to enable this test (developer only!)

Test Summary Report
-------------------
t/mojolicious/websocket_lite_app.t       (Wstat: 256 Tests: 291 Failed: 1)
  Failed test:  56
  Non-zero exit status: 1
Files=93, Tests=10799, 56 wallclock secs ( 0.30 usr  0.20 sys + 35.24 cusr 13.26 csys = 48.99 CPU)
Result: FAIL
Failed 1/93 test programs. 1/10799 subtests failed.
make: *** [Makefile:1403: test_dynamic] Error 255
(make.exe test exited with 512)
CPAN::Reporter: Test result is 'fail', One or more tests failed.

Expected behavior

no errors

Actual behavior

see above under duplicating -- listed most of the output (pertinent, I think)


I went to the line in question and added print code -- lines with [] , package and line# are my output:

[Daemon#0112]req=1, mreq=100
ok 54 - WebSocket handshake with /echo
ok 55 - send message
[Daemon#0112]req=∄, mreq=100
Use of uninitialized value in numeric ge (>=) at lib/Mojo/Server/Daemon.pm line 115.
ok 56 - WebSocket closed with status 1009
[Daemon#0112]req=1, mreq=100

The failing test has an "undef" (the '∄' symbol (There does not exist)) for the req number, the
rest have '1'. I kludged in a '1':

	$c->{requests} = 1 unless $c->{requests};

and all tests 'pass'.

My perl version info:

perl -V
Summary of my perl5 (revision 5 version 22 subversion 4) configuration:

Platform:
osname=cygwin, osvers=2.8.1(0.31253), archname=cygwin-thread-multi
uname='cygwin_nt-6.3 cygwin 2.8.1(0.31253) 2017-07-03 14:11 x86_64 cygwin '
config_args='-des -Dprefix=/usr -Dmksymlinks -Darchname=x86_64-cygwin-threads -Dlibperl=cygperl5_22.dll -Dcc=gcc -Dld=g++ -Accflags=-ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.4-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.4=/usr/src/debug/perl-5.22.4-1 -fwrapv'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.4-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.4=/usr/src/debug/perl-5.22.4-1 -fwrapv -fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2',
optimize='-O3',
cppflags='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.4-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.4=/usr/src/debug/perl-5.22.4-1 -fwrapv -fno-strict-aliasing -fstack-protector-strong'
ccversion='', gccversion='5.4.0', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong'
libpth=/usr/lib
libs=-lpthread -lgdbm -ldb -ldl -lcrypt -lgdbm_compat
perllibs=-lpthread -ldl -lcrypt
libc=/usr/lib/libcygwin.a, so=dll, useshrplib=true, libperl=cygperl5_22.dll
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong'

Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
PERL_IMPLICIT_CONTEXT PERL_NEW_COPY_ON_WRITE
PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV
USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
Built under cygwin
Compiled at Jul 15 2017 20:11:53
%ENV:
PERL5LIB=""
PERL5_CPANPLUS_IS_RUNNING="7036"
PERL5_CPAN_IS_RUNNING="7036"
CYGWIN="system nodosfilewarning winsymlinks:native export"
@inc:
/usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads
/usr/lib/perl5/site_perl/5.22
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads
/usr/lib/perl5/vendor_perl/5.22
/usr/lib/perl5/5.22/x86_64-cygwin-threads
/usr/lib/perl5/5.22
.


I didn't know how to examine it further, so am submitting this.

It does happen on repeated builds (for me, anyway), which probably means you won't be able to reproduce it. If you can't -- then just close this for now, as I "kludged around" the problem as shown above...

@kraih
Copy link
Member

kraih commented Oct 5, 2017

We do automated testing for Windows, this problem does not show up there. https://ci.appveyor.com/project/kraih/mojo

@kraih
Copy link
Member

kraih commented Nov 5, 2017

Closing this issue since no new information has been provided and nobody could verify the problem.

@kraih kraih closed this as completed Nov 5, 2017
@kraih
Copy link
Member

kraih commented Nov 5, 2017

Actually, looking again, it appears there were similar reports on CPAN Testers. http://www.cpantesters.org/cpan/report/4800d2c3-6e16-1014-885e-f9771f639c1c

@kraih kraih reopened this Nov 5, 2017
@kraih kraih closed this as completed in ddcb001 Nov 5, 2017
@kraih
Copy link
Member

kraih commented Nov 5, 2017

No idea what would cause $c->{requests} being undef, but i guess it doesn't hurt to be a little more defensive.

@Zero3K
Copy link

Zero3K commented Feb 7, 2020

Its happening again:

Use of uninitialized value $loop in hash element at /home/Bryan/.cpan/build/Mojolicious-8.32-0/blib/lib/Mojo/UserAgent.pm line 202.
Mojo::Reactor::Poll: I/O watcher failed: Can't call method "remove" on an undefined value at /home/Bryan/.cpan/build/Mojolicious-8.32-0/blib/lib/Mojo/UserAgent.pm line 293.

@Astara
Copy link
Author

Astara commented Feb 8, 2020

"Closing this issue since no new information has been provided and nobody could verify the problem." -- I never received any email notifications that there had been any response. As for automated windows testing not showing the problem and like the "CPAN River 3000" project, use of monoculture in coding or testing will limit the errors found.

There have been multiple times I've run into errors on core modules on linux that were rejected because I didn't have the same test-environment setup. They didn't wish to have "real world" setups that were different from their clean-room test setup. I know that the windows build and tests are done in a special environment that may not be what people have when they use cpan to download and run tests. Here, even if I did get email, saying it works in a clean-room windows test environment, isn't the same as asking for more information (though I noted the code patch, thank you!)..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants