Giter Site home page Giter Site logo

opensuse / mojo-ioloop-readwriteprocess Goto Github PK

View Code? Open in Web Editor NEW
9.0 11.0 13.0 596 KB

Execute external programs or internal code blocks as separate process

License: Other

Perl 98.89% Shell 1.11%
mojo ioloop eventemitter subreaper cgroups process-manager hacktoberfest

mojo-ioloop-readwriteprocess's People

Contributors

adamwill avatar cfconrad avatar foursixnine avatar gregoa avatar knowledgejunkie avatar kraih avatar manwar avatar martchus avatar mudler avatar okurz avatar perlpunk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mojo-ioloop-readwriteprocess's Issues

sporadic errors in test suite, e.g. t/07_autodetect.t , t/12_mocked_container.t , t/04_queues.t , 05_serialize.t

Observation

https://build.opensuse.org/package/live_build_log/devel:openQA:Leap:15.1/perl-Mojo-IOLoop-ReadWriteProcess/openSUSE_Leap_15.1/x86_64 shows

[   97s] TEST error print
[   97s] TEST error print
[   97s] t/01_run.t ............... ok
[  108s] t/02_parallel.t .......... ok
[  109s] Can't use an undefined value as filehandle reference at lib/Mojo/IOLoop/ReadWriteProcess.pm line 298.
[  126s] t/03_func.t .............. ok
[  127s] t/04_queues.t ............ ok
[  127s] t/05_serialize.t ......... ok
[  131s] t/06_events.t ............ ok
[  191s] 
[  191s]     #   Failed test 'collect_status fired 8 times'
[  191s]     #   at t/07_autodetect.t line 411.
[  191s]     #          got: undef
[  191s]     #     expected: '1'
[  191s] 
[  191s]     #   Failed test 'new_subprocess fired 7 times'
[  191s]     #   at t/07_autodetect.t line 412.
[  191s]     #          got: '9'
[  191s]     #     expected: '8'
[  191s] 
[  191s]     #   Failed test 'detection works'
[  191s]     #   at t/07_autodetect.t line 414.
[  191s]     #          got: '9'
[  191s]     #     expected: '8'
[  191s]     # bless( {
[  191s]     #   '_status' => -1,
[  191s]     #   'args' => [],
[  191s]     #   'error' => bless( [], 'Mojo::Collection' ),
[  191s]     #   'error_stream' => bless( \*Symbol::GEN122, 'IO::Handle' ),
[  191s]     #   'events' => {},
[  191s]     #   'execute' => '/home/abuild/rpmbuild/BUILD/Mojo-IOLoop-ReadWriteProcess-0.28/t/data/subreaper/roulette.sh',
[  191s]     #   'process_id' => 1744,
[  191s]     #   'read_stream' => bless( \*Symbol::GEN120, 'IO::Handle' ),
[  191s]     #   'separate_err' => 1,
[  191s]     #   'session' => bless( {
[  191s]     #     'collect_status' => 1,
[  191s]     #     'events' => {
[  191s]     #       'collected' => [
[  191s]     #         sub { "DUMMY" }
[  191s]     #       ],
[  191s]     #       'collected_orphan' => [
[  191s]     #         sub { "DUMMY" }
[  191s]     #       ]
[  191s]     #     },
[  191s]     #     'handler' => undef,
[  191s]     #     'orphans' => {
[  191s]     #       '1744' => bless( {
[  191s]     #         '_status' => 256,
[  191s]     #         'process_id' => 1744
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' ),
[  191s]     #       '1748' => bless( {
[  191s]     #         '_status' => 256,
[  191s]     #         'process_id' => 1748
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' ),
[  191s]     #       '1749' => bless( {
[  191s]     #         '_status' => 256,
[  191s]     #         'process_id' => 1749
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' ),
[  191s]     #       '1755' => bless( {
[  191s]     #         '_status' => 256,
[  191s]     #         'process_id' => 1755
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' ),
[  191s]     #       '1756' => bless( {
[  191s]     #         '_status' => 256,
[  191s]     #         'process_id' => 1756
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' ),
[  191s]     #       '1762' => bless( {
[  191s]     #         '_status' => 0,
[  191s]     #         'process_id' => 1762
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' ),
[  191s]     #       '1763' => bless( {
[  191s]     #         '_status' => 0,
[  191s]     #         'process_id' => 1763
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' ),
[  191s]     #       '1773' => bless( {
[  191s]     #         '_status' => 0,
[  191s]     #         'process_id' => 1773
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' ),
[  191s]     #       '1774' => bless( {
[  191s]     #         '_status' => 0,
[  191s]     #         'process_id' => 1774
[  191s]     #       }, 'Mojo::IOLoop::ReadWriteProcess' )
[  191s]     #     },
[  191s]     #     'process_table' => {
[  191s]     #       '1744' => \$VAR1
[  191s]     #     },
[  191s]     #     'subreaper' => 1
[  191s]     #   }, 'Mojo::IOLoop::ReadWriteProcess::Session' ),
[  191s]     #   'set_pipes' => 1,
[  191s]     #   'subreaper' => 1,
[  191s]     #   'write_stream' => bless( \*Symbol::GEN121, 'IO::Handle' )
[  191s]     # }, 'Mojo::IOLoop::ReadWriteProcess' )
[  191s]     # Looks like you failed 3 tests of 4.
[  191s] 
[  191s] #   Failed test 'subreaper_bash_roulette'
[  191s] #   at t/07_autodetect.t line 418.
[  191s] 0 at t/07_autodetect.t line 414.
[  191s] # Tests were run but no plan was declared and done_testing() was not seen.
[  191s] # Looks like your test exited with 255 just after 7.
[  191s] t/07_autodetect.t ........ 
[  191s] Dubious, test returned 255 (wstat 65280, 0xff00)
[  191s] Failed 1/7 subtests 
[  191s] 	(less 2 skipped subtests: 4 okay)
[  193s] t/08_ioloop.t ............ ok
[  194s] t/09_session.t ........... ok
[  195s] t/10_cgroupv1.t .......... ok
[  196s] t/10_cgroupv2.t .......... ok
[  197s] t/11_containers.t ........ skipped: This test works only if you have cgroups permissions
[  255s] t/12_mocked_container.t .. ok
[  256s] t/13_shared.t ............ skipped: Skipped unless TEST_SHARED is set
[  256s] 
[  256s] Test Summary Report
[  256s] -------------------
[  256s] t/07_autodetect.t      (Wstat: 65280 Tests: 7 Failed: 1)
[  256s]   Failed test:  7
[  256s]   Non-zero exit status: 255
[  256s]   Parse errors: No plan found in TAP output
[  256s] Files=15, Tests=62, 162 wallclock secs ( 0.25 usr  0.15 sys + 11.89 cusr  2.20 csys = 14.49 CPU)
[  256s] Result: FAIL
[  256s] Failed 1/15 test programs. 1/62 subtests failed.

so unhandled output in t/01_run.t, perl warning "Can't use an undefined value as filehandle reference at lib/Mojo/IOLoop/ReadWriteProcess.pm line 298." in t/03_func.t and errors in t/07_autodetect.t

Then in https://build.opensuse.org/package/live_build_log/devel:openQA:Leap:15.2/perl-Mojo-IOLoop-ReadWriteProcess/openSUSE_Leap_15.2/aarch64

[  187s] t/11_containers.t ........ skipped: This test works only if you have cgroups permissions
[  211s] 
[  211s]     #   Failed test 'procs interface contains the added pids'
[  211s]     #   at t/12_mocked_container.t line 37.
[  211s]     #          got: ''
[  211s]     #     expected: '1785
[  211s]     # '
[  211s]     # 1785
[  244s]     # Looks like you failed 1 test of 43.
[  244s] 
[  244s] #   Failed test 'container_3'
[  244s] #   at t/12_mocked_container.t line 258.
[  244s] # Looks like you failed 1 test of 3.
[  244s] t/12_mocked_container.t .. 
[  244s] Dubious, test returned 1 (wstat 256, 0x100)
[  244s] Failed 1/3 subtests

and in
https://build.opensuse.org/package/live_build_log/devel:openQA:Leap:15.2/perl-Mojo-IOLoop-ReadWriteProcess/openSUSE_Leap_15.2/x86_64

[   70s] t/03_func.t .............. ok
[   71s] t/04_queues.t ............ ok
[ 3679s] qemu-system-x86_64: terminating on signal 15 from pid 18026 ()


Job seems to be stuck here, killed. (after 3600 seconds of inactivity)

so stuck in tests.

https://build.opensuse.org/package/live_build_log/devel:openQA:Leap:15.2/perl-Mojo-IOLoop-ReadWriteProcess/openSUSE_Leap_15.2/ppc64le shows again:

[  119s] t/04_queues.t ............ ok
[ 3725s] qemu-system-ppc64: terminating on signal 15 from pid 27286 (<unknown process>)

Not sure if that means that t/04_queues.t is stuck after it returned "ok" or if the next test module "05_serialize.t" starts, gets stuck and never finishes.

Impact

I have not observed an impact going further than these tests failing, e.g. no visible impact on openQA behaviour where we use Mojo-IOLoop-ReadWriteProcess heavily.

Workaround

I will propose to skip the according tests in OBS for now.

Process execution sometimes fails on ppc64le and s390x

I'm working on updating Fedora's openQA packages to the latest git versions. os-autoinst was recently improved to include exit codes in output when running commands via run_diag (which uses ReadWriteProcess's process to do the heavy lifting), and a test for this was added.

In test builds, this test is quite often failing on ppc64le or s390x arch, because the command - a simple echo foo - exits with 1 instead of the expected 0:

2:     #   Failed test 'Exit code appear in log'
2:     #   at ./13-osutils.t line 167.
2:     # STDERR:
2:     # [2021-11-26T19:00:09.618335Z] [debug] running `echo foo`
2:     # [2021-11-26T19:00:09.619749Z] [debug] Command `echo foo` terminated with 1
2:     #   foo
2:     # 
2:     # doesn't match:
2:     # (?^u:terminated with 0)
2:     # as expected
2:     # Looks like you failed 1 test of 10.
2: 
2: #   Failed test 'run_diag'
2: #   at ./13-osutils.t line 190.
2: # Looks like you failed 1 test of 9.

I don't know why this is happening, but it seems likely it's an issue in RWP, I don't see how the code on the os-autoinst side could be causing it.

os-autoinst test failures with v0.31

Since version 0.31 we are seeing the following test failures"

[  212s] 3: 
[  212s] 3: #   Failed test 'exit logged'
[  212s] 3: #   at ./29-backend-driver.t line 31.
[  212s] 3: # STDOUT & STDERR:
[  212s] 3: # [37m[2021-12-06T17:11:16.953486Z] [debug] received magic close
[  212s] 3: # [0m
[  212s] 3: # don't match:
[  212s] 3: # (?^u:backend.*exited)
[  212s] 3: # as expected
[  212s] 3: [37m[2021-12-06T17:11:17.057808Z] [debug] backend process exited: 72057594037927935
[  212s] 3: [0m# Looks like you failed 1 test of 12.
[  212s] 3: [17:11:17] ./29-backend-driver.t .................... 
[  212s] 3: Dubious, test returned 1 (wstat 256, 0x100)
[  212s] 3: Failed 1/12 subtests 

Also we see this:

Can't open out pipe for reading Interrupted system call at ./10-virtio_terminal.t line 44.

https://github.com/os-autoinst/os-autoinst/blob/master/t/29-backend-driver.t#L31

More details: https://progress.opensuse.org/issues/103422#note-20

t/01_run.t fails with: Error: Failed test 'sigchld_handler.pl exit with 0' got: '255' expected: '0'

= GitHub Actions Report =
Notice: See the full report in: https://github.com/openSUSE/Mojo-IOLoop-ReadWriteProcess/actions/runs/7101104914
Error: Failed test 'sigchld_handler.pl exit with 0'
--- CAPTURED CONTEXT ---
got: '255'
expected: '0'
--- END OF CONTEXT ---
Error: Failed test 'SIG_CHLD handler was executed'
--- CAPTURED CONTEXT ---
''
doesn't match '(?^:SIG_CHLD)'
--- END OF CONTEXT ---
Error: Failed test 'SIG_CHLD handler in spawned process'

The tests in t/10_cgroupv* use invalid paths

The tests in t/10_cgroupv* use invalid paths. This wasn't a huge problem until Mojolicious 8.23 was released. In that version, Mojo::File was modified not to allow undefined values in paths.

This breaks the tests in t/10_cgroupv*.

Proposal: Move to https://github.com/openSUSE

We see this project being actively used by e.g. the os-autoinst project , there are packages within openSUSE and there is active review and contribution work by multiple contributors (and less the original author). I suggest to move the project to the openSUSE scope in github. If you agree then I suggest you (any owner of the project) transfer the ownership in the github settings. Someone in the openSUSE project (not sure if I can do this) should be able to accept the request.

tests hang on Windows

03_func.t:

# Subtest: _new_err
    ok 1
    ok 2
    1..2
ok 1 - _new_err
# Subtest: write_pidfile
    ok 1
    1..1
ok 2 - write_pidfile
# Subtest: _fork
Can't use an undefined value as filehandle reference at lib/Mojo/IOLoop/ReadWriteProcess.pm line 229.
(hangs)

If your module cannot work on Windows at all, you can die in Makefile.PL/Build.PL. See http://wiki.cpantesters.org/wiki/CPANAuthorNotes for how to do this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.