about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-10 12:15:08 +0000
committerEric Wong <e@80x24.org>2021-01-12 03:51:42 +0000
commitc1339190c4d682db1cb23331ff0c247f42e3904f (patch)
tree5735205eebb88db1c5b3fa956d9c368c5efadb43 /t
parent1ff129f4429686f6dfcde565574f05b21986f6a0 (diff)
downloadpublic-inbox-c1339190c4d682db1cb23331ff0c247f42e3904f.tar.gz
We'll enable automatic cleanup when IPC classes go out-of-scope
to avoid leaving zombies around.

->wq_workers will be a useful convenience method to change
worker counts.
Diffstat (limited to 't')
-rw-r--r--t/ipc.t10
1 files changed, 7 insertions, 3 deletions
diff --git a/t/ipc.t b/t/ipc.t
index 51e347c6..903294c5 100644
--- a/t/ipc.t
+++ b/t/ipc.t
@@ -170,11 +170,15 @@ is($warn[2], $warn[1], 'worker did not die');
 
 $SIG{__WARN__} = 'DEFAULT';
 is($ipc->wq_workers_start('wq', 1), $$, 'workers started again');
-is(scalar(keys %{$ipc->{-wq_workers}}), 1, '1 worker started');
+is($ipc->wq_workers, 1, '1 worker started');
 $ipc->wq_worker_incr;
-is(scalar(keys %{$ipc->{-wq_workers}}), 2, 'worker count bumped');
+is($ipc->wq_workers, 2, 'worker count bumped');
 $ipc->wq_worker_decr;
 $ipc->wq_worker_decr_wait(10);
-is(scalar(keys %{$ipc->{-wq_workers}}), 1, 'worker count lowered');
+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');
+$ipc->wq_close;
+is($ipc->wq_workers, undef, 'workers undef after close');
 
 done_testing;