… | |
… | |
21 | BEGIN { require AnyEvent::Impl::Perl unless $ENV{PERL_ANYEVENT_MODEL} } |
21 | BEGIN { require AnyEvent::Impl::Perl unless $ENV{PERL_ANYEVENT_MODEL} } |
22 | |
22 | |
23 | $| = 1; print "1..15\n"; |
23 | $| = 1; print "1..15\n"; |
24 | |
24 | |
25 | print "ok 1\n"; |
25 | print "ok 1\n"; |
|
|
26 | |
|
|
27 | $AnyEvent::MAX_SIGNAL_LATENCY = 0.05; |
26 | |
28 | |
27 | my ($a, $b) = AnyEvent::Util::portable_socketpair; |
29 | my ($a, $b) = AnyEvent::Util::portable_socketpair; |
28 | |
30 | |
29 | # I/O write |
31 | # I/O write |
30 | { |
32 | { |
… | |
… | |
90 | print $s == 0 ? "" : "not ", "ok 6 # $s\n"; |
92 | print $s == 0 ? "" : "not ", "ok 6 # $s\n"; |
91 | |
93 | |
92 | kill INT => $$; |
94 | kill INT => $$; |
93 | |
95 | |
94 | $cv = AE::cv; |
96 | $cv = AE::cv; |
95 | $wt = AE::timer 0.01, 0, $cv; |
97 | $wt = AE::timer 0.2, 0, $cv; # maybe OS X needs more time here? or maybe some buggy arm kernel? |
96 | |
98 | |
97 | $s = 0; |
99 | $s = 0; |
98 | $cv->recv; |
100 | $cv->recv; |
99 | |
101 | |
100 | print $s == 3 ? "" : "not ", "ok 7 # $s\n"; |
102 | print $s == 3 ? "" : "not ", "ok 7 # $s\n"; |
… | |
… | |
105 | $s = 0; |
107 | $s = 0; |
106 | $cv->recv; |
108 | $cv->recv; |
107 | |
109 | |
108 | print $s == 0 ? "" : "not ", "ok 8 # $s\n"; |
110 | print $s == 0 ? "" : "not ", "ok 8 # $s\n"; |
109 | } |
111 | } |
110 | |
|
|
111 | $AnyEvent::MAX_SIGNAL_LATENCY = 0.2; |
|
|
112 | |
112 | |
113 | # child |
113 | # child |
114 | { |
114 | { |
115 | my $cv = AE::cv; |
115 | my $cv = AE::cv; |
116 | my $wt = AE::timer 0.01, 0, $cv; |
116 | my $wt = AE::timer 0.01, 0, $cv; |