]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/ipc.t
ipc: wq: handle >MAX_ARG_STRLEN && <EMSGSIZE case
[public-inbox.git] / t / ipc.t
diff --git a/t/ipc.t b/t/ipc.t
index ca88eb59d4ed8fe4dc16fcd2d24ea7c973e060c6..7983fdc02ef1bcffcd479e860b2c92dd0c7c8dba 100644 (file)
--- a/t/ipc.t
+++ b/t/ipc.t
@@ -122,11 +122,16 @@ for my $t ('local', 'worker', 'worker again') {
        $ipc->wq_io_do('test_sha', [ $wa, $wb ], 'hello world');
        is(readline($rb), sha1_hex('hello world')."\n", "SHA small ($t)");
        {
-               my $bigger = $big x 10;
+               my $bigger = $big x 10; # to hit EMSGSIZE
                $ipc->wq_io_do('test_sha', [ $wa, $wb ], $bigger);
                my $exp = sha1_hex($bigger)."\n";
-               undef $bigger;
-               is(readline($rb), $exp, "SHA big ($t)");
+               is(readline($rb), $exp, "SHA big for EMSGSIZE ($t)");
+
+               # to hit the WQWorker recv_and_run length
+               substr($bigger, my $MY_MAX_ARG_STRLEN = 4096 * 33, -1) = '';
+               $ipc->wq_io_do('test_sha', [ $wa, $wb ], $bigger);
+               $exp = sha1_hex($bigger)."\n";
+               is(readline($rb), $exp, "SHA WQWorker limit ($t)");
        }
        my $ppid = $ipc->wq_workers_start('wq', 1);
        push(@ppids, $ppid);