Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a7c7d31

Browse files
committed
Fix postgres_fdw tsdtm isolation test.
1 parent a6c926a commit a7c7d31

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

contrib/postgres_fdw/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ endif
2828

2929
# Poor's man overload of already defined target: just copy it
3030
check: submake $(REGRESS_PREP)
31-
# $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
31+
$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
3232
env DESTDIR='$(abs_top_builddir)'/tmp_install make install
3333
$(prove_check)

contrib/postgres_fdw/t/001_bank_check.pl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use strict;
22
use warnings;
3+
use File::Basename;
4+
use File::Spec::Functions 'catfile';
35

46
use PostgresNode;
57
use TestLib;
@@ -10,7 +12,7 @@
1012
$master->append_conf('postgresql.conf', qq(
1113
max_prepared_transactions = 30
1214
log_checkpoints = true
13-
# postgres_fdw.use_global_snapshots = on
15+
postgres_fdw.use_global_snapshots = on
1416
));
1517
$master->start;
1618

@@ -19,7 +21,6 @@
1921
$shard1->append_conf('postgresql.conf', qq(
2022
max_prepared_transactions = 30
2123
log_checkpoints = true
22-
# shared_preload_libraries = 'pg_tsdtm'
2324
));
2425
$shard1->start;
2526

@@ -28,7 +29,6 @@
2829
$shard2->append_conf('postgresql.conf', qq(
2930
max_prepared_transactions = 30
3031
log_checkpoints = true
31-
# shared_preload_libraries = 'pg_tsdtm'
3232
));
3333
$shard2->start;
3434

@@ -47,7 +47,8 @@
4747

4848
$master->psql('postgres', "CREATE SERVER shard_$port FOREIGN DATA WRAPPER postgres_fdw options(dbname 'postgres', host '$host', port '$port')");
4949
$master->psql('postgres', "CREATE FOREIGN TABLE accounts_fdw_$port() inherits (accounts) server shard_$port options(table_name 'accounts')");
50-
$master->psql('postgres', "CREATE USER MAPPING for stas SERVER shard_$port options (user 'stas')");
50+
my $me = scalar(getpwuid($<));
51+
$master->psql('postgres', "CREATE USER MAPPING for $me SERVER shard_$port options (user '$me')");
5152

5253
# diag("done $host $port");
5354
}
@@ -66,10 +67,10 @@
6667
my $oldtotal = '0';
6768
my $isolation_error = 0;
6869

70+
my $pgb_path = catfile(dirname(__FILE__), "bank.pgb");
71+
$master->pgbench(-n, -c => 5, -t => 10, -f => "$pgb_path", 'postgres' );
6972

70-
$master->pgbench(-n, -c => 5, -t => 10, -f => "$TestLib::log_path/../../t/bank.pgb", 'postgres' );
71-
72-
my $pgb_handle = $master->pgbench_async(-n, -c => 5, -T => $seconds, -f => "$TestLib::log_path/../../t/bank.pgb", 'postgres' );
73+
my $pgb_handle = $master->pgbench_async(-n, -c => 5, -T => $seconds, -f => "$pgb_path", 'postgres' );
7374

7475
my $started = time();
7576
while (time() - $started < $seconds)

0 commit comments

Comments
 (0)