[Catalyst] IO::Pipe and the Catalyst Server

Bill Moseley moseley at hank.org
Thu Feb 5 17:25:34 GMT 2009


On Thu, Feb 05, 2009 at 04:28:57PM +0100, Florian Ragwitz wrote:
> On Thu, Feb 05, 2009 at 07:10:07AM -0800, Bill Moseley wrote:
> > Same problem.
> 
> Would you mind preparing a testcase for this?

I can try.  See attached diff against svn 9215.

$ prove -vl t/live_fork.t 
t/live_fork....
1..15
TestApp is trying to use NEXT, which is deprecated. Please see the Class::C3::Adopt::NEXT documentation for details at /home/moseley/cat_5.8/t/lib/Catalyst/Plugin/Test/Plugin.pm line 23
ok 1 - system
ok 2 - is YAML
ok 3 - exited OK
ok 4 - `backticks`
ok 5 - is YAML
ok 6 - exited successfully
ok 7 - contains ^/bin/ls$
ok 8 - contains two newlines
ok 9 - fork
ok 10 - is YAML
ok 11 - fork's "pid" wasn't 0
ok 12 - fork got a new pid
ok 13 - fork was effective
ok 14 - io_pipe
ok 15 - io_pipe returned data from handle
ok
All tests successful.
Files=1, Tests=15,  1 wallclock secs ( 0.02 usr  0.01 sys +  0.98 cusr  0.06 csys =  1.07 CPU)
Result: PASS



> 
> TestApp::Controller::Fork / t/live_fork.t already has similar tests. You
> can run them against the dev server using t/optional_http-server.t.

Should App::Prove be listed as a dependency in test_requires?
(although test_requires doesn't seem to work like I think it should.  ;)


Not 100% clear on how to run it but here's my attempt:
(trimmed a bit):

$ TEST_HTTP=1 REMOTE_FORK=1 perl -Ilib t/optional_http-server.t t/live_fork.t 
1..1
created "TestApp"
created "TestApp/script"
[...]
Waiting for server to start...
1..15
ok 1 - system
Use of uninitialized value in join or string at t/live_fork.t line 32.
ok 2 - is YAML
ok 3 - exited OK
ok 4 - `backticks`
ok 5 - is YAML
ok 6 - exited successfully
ok 7 - contains ^/bin/ls$
ok 8 - contains two newlines
ok 9 - fork
ok 10 - is YAML
ok 11 - fork's "pid" wasn't 0
ok 12 - fork got a new pid
ok 13 - fork was effective
ok 14 - io_pipe
not ok 15 - io_pipe returned data from handle
#   Failed test 'io_pipe returned data from handle'
#   at t/live_fork.t line 70.
#          got: 'FATAL ERROR: Caught exception in TestApp::Controller::Fork->io_pipe "Failed read from IO::Pipe handle at /home/moseley/cat_5.8/t/tmp/TestApp/script/../lib/TestApp/Controller/Fork.pm line 72."'
#     expected: 'ok'
# Looks like you failed 1 test of 15.
not ok 1 - live tests
#   Failed test 'live tests'
#   at t/optional_http-server.t line 69.
#          got: '256'
#     expected: '0'
# Looks like you failed 1 test of 1.


-- 
Bill Moseley
moseley at hank.org
Sent from my iMutt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: io_pipe.diff
Type: text/x-diff
Size: 1396 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090205/584664cb/io_pipe.bin


More information about the Catalyst mailing list