]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/run: TEST_LEI_DAEMON_PERSIST: die if pid changes
authorEric Wong <e@80x24.org>
Tue, 14 Sep 2021 02:39:03 +0000 (02:39 +0000)
committerEric Wong <e@80x24.org>
Tue, 14 Sep 2021 02:56:53 +0000 (02:56 +0000)
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

index b0ee611a44626184cf8db19c4f781b620cad6be9..e5ee0ade3de72ca57467e27f72f128b27484de0e 100755 (executable)
@@ -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;
 }