diff options
author | Eric Wong <e@80x24.org> | 2023-10-31 20:42:52 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-01 07:08:09 +0000 |
commit | fdf90c0ffbf608ed08665eaffa5c750fa5a5bfee (patch) | |
tree | f9365a4472ef6e5dda901c68cc7c36b7da8c9fff /t/ds-poll.t | |
parent | 4d2f3651bde2f2c61b78973df56b6e6ee37a6dce (diff) | |
download | public-inbox-fdf90c0ffbf608ed08665eaffa5c750fa5a5bfee.tar.gz |
The epoll implementation is the only one which respects the limit (kevent would, but IO::KQueue does not). In any case, I'm not a fan of the maxevents=1000 historical default since it leads to fairness problems with shared non-blocking listeners across multiple daemon workers.
Diffstat (limited to 't/ds-poll.t')
-rw-r--r-- | t/ds-poll.t | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/t/ds-poll.t b/t/ds-poll.t index 7a7e2bcf..321534bd 100644 --- a/t/ds-poll.t +++ b/t/ds-poll.t @@ -16,33 +16,33 @@ pipe($r, $w); pipe($x, $y); is($p->ep_add($r, EPOLLIN), 0, 'add EPOLLIN'); my $events = []; -$p->ep_wait(9, 0, $events); +$p->ep_wait(0, $events); is_deeply($events, [], 'no events set'); is($p->ep_add($w, EPOLLOUT|EPOLLONESHOT), 0, 'add EPOLLOUT|EPOLLONESHOT'); -$p->ep_wait(9, -1, $events); +$p->ep_wait(-1, $events); is(scalar(@$events), 1, 'got POLLOUT event'); is($events->[0], fileno($w), '$w ready'); -$p->ep_wait(9, 0, $events); +$p->ep_wait(0, $events); is(scalar(@$events), 0, 'nothing ready after oneshot'); is_deeply($events, [], 'no events set after oneshot'); syswrite($w, '1') == 1 or die; for my $t (0..1) { - $p->ep_wait(9, $t, $events); + $p->ep_wait($t, $events); is($events->[0], fileno($r), "level-trigger POLLIN ready #$t"); is(scalar(@$events), 1, "only event ready #$t"); } syswrite($y, '1') == 1 or die; is($p->ep_add($x, EPOLLIN|EPOLLONESHOT), 0, 'EPOLLIN|EPOLLONESHOT add'); -$p->ep_wait(9, -1, $events); +$p->ep_wait(-1, $events); is(scalar @$events, 2, 'epoll_wait has 2 ready'); my @fds = sort @$events; my @exp = sort((fileno($r), fileno($x))); is_deeply(\@fds, \@exp, 'got both ready FDs'); is($p->ep_del($r, 0), 0, 'EPOLL_CTL_DEL OK'); -$p->ep_wait(9, 0, $events); +$p->ep_wait(0, $events); is(scalar @$events, 0, 'nothing ready after EPOLL_CTL_DEL'); is($p->ep_add($r, EPOLLIN), 0, 're-add'); @@ -54,7 +54,7 @@ SKIP: { my @w; eval { local $SIG{__WARN__} = sub { push @w, @_ }; - $p->ep_wait(9, 0, $events); + $p->ep_wait(0, $events); }; ok($@, 'error detected from bad FD'); ok($!{EBADF}, 'EBADF errno set'); |