From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 80DEE1F9F3 for ; Tue, 14 Sep 2021 02:39:05 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/5] t/run: TEST_LEI_DAEMON_PERSIST: die if pid changes Date: Tue, 14 Sep 2021 02:39:03 +0000 Message-Id: <20210914023905.21410-4-e@80x24.org> In-Reply-To: <20210914023905.21410-1-e@80x24.org> References: <20210914023905.21410-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: While persisting lei-daemon across different test cases isn't the default anymore, we can notice problems more quickly if the daemon PID changes since the daemon gets auto-restarted after failures. --- t/run.perl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/run.perl b/t/run.perl index b0ee611a..e5ee0ade 100755 --- a/t/run.perl +++ b/t/run.perl @@ -254,5 +254,8 @@ for (my $i = $repeat; $i != 0; $i--) { print $OLDOUT "1..".($repeat * scalar(@tests))."\n" if $repeat >= 0; if ($lei_env && $$ == $owner_pid) { my $opt = { 1 => $OLDOUT, 2 => $OLDERR }; + my $cur_daemon_pid; + run_script([qw(lei daemon-pid)], $lei_env, { 1 => \$cur_daemon_pid }); run_script([qw(lei daemon-kill)], $lei_env, $opt); + DIE "lei daemon restarted\n" if $cur_daemon_pid != $lei_daemon_pid; }