Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit016314d

Browse files
committed
TAP test compatibility with PG15 (part 2).
Automatically use old and new style node creation.
1 parent922bfbd commit016314d

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

‎t/001_wal.pl

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
# Test generic xlog record work for rum index replication.
22
use strict;
33
use warnings;
4-
use PostgreSQL::Test::Cluster;
5-
use PostgreSQL::Test::Utils;
64
use Test::Moretests=> 31;
75

6+
my$pg_15_modules;
7+
8+
BEGIN
9+
{
10+
$pg_15_modules =eval
11+
{
12+
require PostgreSQL::Test::Cluster;
13+
require PostgreSQL::Test::Utils;
14+
return 1;
15+
};
16+
17+
unless (defined$pg_15_modules)
18+
{
19+
$pg_15_modules = 0;
20+
21+
require PostgresNode;
22+
require TestLib;
23+
}
24+
}
25+
26+
note('PostgreSQL 15 modules are used:' . ($pg_15_modules ?'yes' :'no'));
27+
28+
829
my$node_master;
930
my$node_standby;
1031

@@ -50,7 +71,23 @@ sub test_index_replay
5071
}
5172

5273
# Initialize master node
53-
$node_master = PostgreSQL::Test::Cluster->new('master');
74+
75+
# Create node.
76+
# Older versions of PostgreSQL modules use get_new_node function.
77+
# Newer use standard perl object constructor syntax.
78+
# Also applies for node_standby (below).
79+
eval
80+
{
81+
if ($pg_15_modules)
82+
{
83+
$node_master = PostgreSQL::Test::Cluster->new("master");
84+
}
85+
else
86+
{
87+
$node_master = PostgresNode::get_new_node("master");
88+
}
89+
};
90+
5491
$node_master->init(allows_streaming=> 1);
5592
$node_master->start;
5693
my$backup_name ='my_backup';
@@ -59,7 +96,18 @@ sub test_index_replay
5996
$node_master->backup($backup_name);
6097

6198
# Create streaming standby linking to master
62-
$node_standby = PostgreSQL::Test::Cluster->new('standby');
99+
eval
100+
{
101+
if ($pg_15_modules)
102+
{
103+
$node_standby = PostgreSQL::Test::Cluster->new("standby");
104+
}
105+
else
106+
{
107+
$node_standby = PostgresNode::get_new_node("standby");
108+
}
109+
};
110+
63111
$node_standby->init_from_backup($node_master,$backup_name,
64112
has_streaming=> 1);
65113
$node_standby->start;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp