]> Sergey Matveev's repositories - public-inbox.git/commitdiff
testcommon: DS->Reset when using fork-only subprocess
authorEric Wong <e@yhbt.net>
Tue, 23 Jun 2020 20:51:49 +0000 (20:51 +0000)
committerEric Wong <e@yhbt.net>
Tue, 23 Jun 2020 21:17:34 +0000 (21:17 +0000)
This fixes a bug on FreeBSD 11 here -nntpd + TEST_RUN_MODE=2
(default) was occasionally causing failures in t/v2writable.t
due to the kqueue descriptor being auto-closed by the OS on fork.

lib/PublicInbox/TestCommon.pm

index 6bf4526a9f707d44d36ed0fcb8cb169c4e8aac89..dc360135569c762ea9cc1953e4aa8617d044d90c 100644 (file)
@@ -372,6 +372,7 @@ sub start_script {
                }
                $0 = join(' ', @$cmd);
                if ($sub) {
+                       eval { PublicInbox::DS->Reset };
                        _run_sub($sub, $key, \@argv);
                        POSIX::_exit($? >> 8);
                } else {