X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fipc.t;h=fd4d559962c877d7125f3d554b41721558bf710a;hb=1d88b8639596a549dd972e113b52f9c2d035d529;hp=202b1cc658df533b1a52b44676a19389808081a5;hpb=6082492b14ee2a24b0131ce0a99b26ee316a4d88;p=public-inbox.git
diff --git a/t/ipc.t b/t/ipc.t
index 202b1cc6..fd4d5599 100644
--- a/t/ipc.t
+++ b/t/ipc.t
@@ -1,19 +1,19 @@
#!perl -w
-# Copyright (C) 2020-2021 all contributors
+# Copyright (C) all contributors
# License: AGPL-3.0+
use strict;
use v5.10.1;
use Test::More;
use PublicInbox::TestCommon;
use Fcntl qw(SEEK_SET);
-use Digest::SHA qw(sha1_hex);
+use PublicInbox::SHA qw(sha1_hex);
require_mods(qw(Storable||Sereal));
require_ok 'PublicInbox::IPC';
my ($tmpdir, $for_destroy) = tmpdir();
state $once = eval <<'';
package PublicInbox::IPC;
use strict;
-use Digest::SHA qw(sha1_hex);
+use PublicInbox::SHA qw(sha1_hex);
sub test_array { qw(test array) }
sub test_scalar { 'scalar' }
sub test_scalarref { \'scalarref' }
@@ -180,24 +180,13 @@ SKIP: {
is($warn[2], $warn[1], 'worker did not die');
$SIG{__WARN__} = 'DEFAULT';
- is($ipc->wq_workers_start('wq', 1), $$, 'workers started again');
- is($ipc->wq_workers, 1, '1 worker started');
-
- $ipc->wq_worker_incr;
- is($ipc->wq_workers, 2, 'worker count bumped');
- $ipc->wq_worker_decr;
- $ipc->wq_worker_decr_wait(10);
- is($ipc->wq_workers, 1, 'worker count lowered');
- is($ipc->wq_workers(2), 2, 'worker count set');
- is($ipc->wq_workers, 2, 'worker count stayed set');
-
+ is($ipc->wq_workers_start('wq', 2), $$, 'workers started again');
$ipc->wq_broadcast('test_append_pid', "$tmpdir/append_pid");
$ipc->wq_close;
open my $fh, '<', "$tmpdir/append_pid" or BAIL_OUT "open: $!";
chomp(my @pids = <$fh>);
my %pids = map { $_ => 1 } grep(/\A[0-9]+\z/, @pids);
is(scalar keys %pids, 2, 'broadcast hit both PIDs');
- is($ipc->wq_workers, undef, 'workers undef after close');
}
done_testing;