about summary refs log tree commit homepage
path: root/t/cmd_ipc.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-12-12 04:22:00 +0000
committerEric Wong <e@80x24.org>2022-12-12 20:57:45 +0000
commitcf4cbaac260b5c24ed7173c39e0e18c0f0deb89f (patch)
tree96fed340a906138762d1768660cf8ac6f6f5f764 /t/cmd_ipc.t
parent7f70bf3c6aab60f494842504e1267e719515430b (diff)
downloadpublic-inbox-cf4cbaac260b5c24ed7173c39e0e18c0f0deb89f.tar.gz
This makes it easier to identify places in tests which cause
unnecessary slowdowns doing busy waits.
Diffstat (limited to 't/cmd_ipc.t')
-rw-r--r--t/cmd_ipc.t3
1 files changed, 1 insertions, 2 deletions
diff --git a/t/cmd_ipc.t b/t/cmd_ipc.t
index 75697a15..cd76d5e8 100644
--- a/t/cmd_ipc.t
+++ b/t/cmd_ipc.t
@@ -10,7 +10,6 @@ pipe(my ($r, $w)) or BAIL_OUT;
 my ($send, $recv);
 require_ok 'PublicInbox::Spawn';
 my $SOCK_SEQPACKET = eval { Socket::SOCK_SEQPACKET() } // undef;
-use Time::HiRes qw(usleep);
 
 my $do_test = sub { SKIP: {
         my ($type, $flag, $desc) = @_;
@@ -61,7 +60,7 @@ my $do_test = sub { SKIP: {
                         if ($pid == 0) {
                                 # need to loop since Perl signals are racy
                                 # (the interpreter doesn't self-pipe)
-                                while (usleep(1000)) {
+                                while (tick(0.01)) {
                                         kill 'ALRM', $tgt;
                                 }
                         }