mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Skip psql's TAP test for query cancellation entirely on Windows
This changes 020_cancel.pl so as the test is entirely skipped on Windows. This test was already doing nothing under WIN32, except initializing and starting a node without using it so this shaves a few test cycles. Author: Yugo NAGATA Reviewed-by: Fabien Coelho Discussion: https://postgr.es/m/20230810125935.22c2922ea5250ba79358965b@sraoss.co.jp Backpatch-through: 15
This commit is contained in:
parent
e434e21e11
commit
c53e288dba
@ -9,21 +9,22 @@ use PostgreSQL::Test::Utils;
|
||||
use Test::More;
|
||||
use Time::HiRes qw(usleep);
|
||||
|
||||
my $tempdir = PostgreSQL::Test::Utils::tempdir;
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('main');
|
||||
$node->init;
|
||||
$node->start;
|
||||
|
||||
# Test query canceling by sending SIGINT to a running psql
|
||||
#
|
||||
# There is, as of this writing, no documented way to get the PID of
|
||||
# the process from IPC::Run. As a workaround, we have psql print its
|
||||
# own PID (which is the parent of the shell launched by psql) to a
|
||||
# file.
|
||||
SKIP:
|
||||
if ($windows_os)
|
||||
{
|
||||
skip "cancel test requires a Unix shell", 2 if $windows_os;
|
||||
plan skip_all => "cancel test requires a Unix shell";
|
||||
}
|
||||
|
||||
my $tempdir = PostgreSQL::Test::Utils::tempdir;
|
||||
|
||||
my $node = PostgreSQL::Test::Cluster->new('main');
|
||||
$node->init;
|
||||
$node->start;
|
||||
|
||||
local %ENV = $node->_get_env();
|
||||
|
||||
@ -49,9 +50,9 @@ SKIP:
|
||||
my $psql_pid;
|
||||
until (
|
||||
-s "$tempdir/psql.pid"
|
||||
and ($psql_pid =
|
||||
PostgreSQL::Test::Utils::slurp_file("$tempdir/psql.pid")) =~
|
||||
/^\d+\n/s)
|
||||
and
|
||||
($psql_pid = PostgreSQL::Test::Utils::slurp_file("$tempdir/psql.pid"))
|
||||
=~ /^\d+\n/s)
|
||||
{
|
||||
($count++ < 100 * $PostgreSQL::Test::Utils::timeout_default)
|
||||
or die "pid file did not appear";
|
||||
@ -75,6 +76,5 @@ SKIP:
|
||||
$stderr,
|
||||
qr/canceling statement due to user request/,
|
||||
'query was canceled');
|
||||
}
|
||||
|
||||
done_testing();
|
||||
|
Loading…
x
Reference in New Issue
Block a user