From b9173c86876b74eb844441c94139cd623c58bda4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 14 Sep 2021 02:39:03 +0000 Subject: [PATCH] t/run: TEST_LEI_DAEMON_PERSIST: die if pid changes 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; } -- 2.44.0