Backport IPC::Run optimization to src/test/perl.
authorNoah Misch <noah@leadboat.com>
Sat, 6 Apr 2024 16:27:55 +0000 (09:27 -0700)
committerNoah Misch <noah@leadboat.com>
Sat, 6 Apr 2024 16:27:55 +0000 (09:27 -0700)
This one-liner makes the TAP portion of "make check-world" 7% faster on
a non-Windows machine.

Discussion: https://postgr.es/m/20240331050310.09@rfd.leadboat.com

src/test/perl/PostgreSQL/Test/Utils.pm

index 42d5a50dc887d8a4d91f0b2b04cbfd27ceaecf43..022b44ba22bc9d773f9fa1546a97b0ed8a909efa 100644 (file)
@@ -189,6 +189,11 @@ Set to true when running under MSYS2.
 
 INIT
 {
+   # See https://github.com/cpan-authors/IPC-Run/commit/fc9288c for how this
+   # reduces idle time.  Remove this when IPC::Run 20231003.0 is too old to
+   # matter (when all versions that matter provide the optimization).
+   $SIG{CHLD} = sub { }
+     unless defined $SIG{CHLD};
 
    # Return EPIPE instead of killing the process with SIGPIPE.  An affected
    # test may still fail, but it's more likely to report useful facts.