Skip to content

Commit ec3c469

Browse files
committed
Disable .psqlrc in parallel_conn.sh
I have the timer enabled in my ~/.psqlrc, which messed with the collection of output in `parallel_conn.sh`, so tests never ran in parallel. So use -X to disable `.psqlrc`, and add some other options to eliminate other stuff that might appear in the output. Restores parallel testing on 9.6 and later on my box, which means the partition test is properly skipped on 9.6. Mostly fixes issue #279, though we should also be sure that serialized tests always pass, too.
1 parent 07ba0c5 commit ec3c469

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Diff for: test/sql/partitions.sql

+15-15
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ SELECT plan(102);
88
SET client_min_messages = warning;
99

1010
-- Create inherited tables (not partitions).
11-
CREATE TABLE public.parent(id INT PRIMARY KEY);
12-
CREATE TABLE public.child(id INT PRIMARY KEY) INHERITS (public.parent);
11+
CREATE TABLE public.base(id INT PRIMARY KEY);
12+
CREATE TABLE public.sub(id INT PRIMARY KEY) INHERITS (public.base);
1313

1414
-- Create a partitioned table with two partitions.
1515
CREATE TABLE public.parted(id INT NOT NULL) PARTITION BY RANGE (id);
@@ -67,49 +67,49 @@ SELECT * FROM check_test(
6767

6868
-- is_partition_of() should fail for inherited but not partitioned tables.
6969
SELECT * FROM check_test(
70-
is_partition_of( 'public', 'child', 'public', 'parent', 'whatevs' ),
70+
is_partition_of( 'public', 'sub', 'public', 'base', 'whatevs' ),
7171
false,
7272
'is_partition_of( csch, non-part ctab, psch, non-part ptab, desc )',
7373
'whatevs',
7474
''
7575
);
7676

7777
SELECT * FROM check_test(
78-
is_partition_of( 'child', 'parent', 'whatevs' ),
78+
is_partition_of( 'sub', 'base', 'whatevs' ),
7979
false,
8080
'is_partition_of( non-part ctab, non-part ptab, desc )',
8181
'whatevs',
8282
''
8383
);
8484

85-
-- is_partition_of() should fail for parted table and non-part child.
85+
-- is_partition_of() should fail for parted table and non-part sub.
8686
SELECT * FROM check_test(
87-
is_partition_of( 'public', 'child', 'public', 'parted', 'whatevs' ),
87+
is_partition_of( 'public', 'sub', 'public', 'parted', 'whatevs' ),
8888
false,
8989
'is_partition_of( csch, non-part ctab, psch, ptab, desc )',
9090
'whatevs',
9191
''
9292
);
9393

9494
SELECT * FROM check_test(
95-
is_partition_of( 'child', 'parted', 'whatevs' ),
95+
is_partition_of( 'sub', 'parted', 'whatevs' ),
9696
false,
9797
'is_partition_of( non-part ctab, ptab, desc )',
9898
'whatevs',
9999
''
100100
);
101101

102-
-- is_partition_of() should fail for partition child but wrong parent.
102+
-- is_partition_of() should fail for partition sub but wrong base.
103103
SELECT * FROM check_test(
104-
is_partition_of( 'public', 'part1', 'public', 'parent', 'whatevs' ),
104+
is_partition_of( 'public', 'part1', 'public', 'base', 'whatevs' ),
105105
false,
106106
'is_partition_of( csch, ctab, psch, non-part ptab, desc )',
107107
'whatevs',
108108
''
109109
);
110110

111111
SELECT * FROM check_test(
112-
is_partition_of( 'part1', 'parent', 'whatevs' ),
112+
is_partition_of( 'part1', 'base', 'whatevs' ),
113113
false,
114114
'is_partition_of( ctab, non-part ptab, desc )',
115115
'whatevs',
@@ -152,7 +152,7 @@ SELECT * FROM check_test(
152152
''
153153
);
154154

155-
-- Should find public partition for hidden parent.
155+
-- Should find public partition for hidden base.
156156
SELECT * FROM check_test(
157157
is_partition_of( 'public', 'not_hidden_part3', 'hide', 'hidden_parted', 'whatevs' ),
158158
true,
@@ -307,21 +307,21 @@ SELECT * FROM check_test(
307307

308308
-- Should not work for unpartitioned but inherited table
309309
SELECT * FROM check_test(
310-
partitions_are( 'public', 'parent', '{child}', 'hi' ),
310+
partitions_are( 'public', 'base', '{sub}', 'hi' ),
311311
false,
312312
'partitions_are( sch, non-parted tab, inherited tab, desc )',
313313
'hi',
314314
' Missing partitions:
315-
child'
315+
sub'
316316
);
317317

318318
SELECT * FROM check_test(
319-
partitions_are( 'parent', '{child}'::name[], 'hi' ),
319+
partitions_are( 'base', '{sub}'::name[], 'hi' ),
320320
false,
321321
'partitions_are( non-parted tab, inherited tab, desc )',
322322
'hi',
323323
' Missing partitions:
324-
child'
324+
sub'
325325
);
326326

327327
-- Should not work for non-existent table.

Diff for: tools/parallel_conn.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fi
2222

2323
COMMAND="SELECT greatest(1, current_setting('max_connections')::int - current_setting('superuser_reserved_connections')::int - (SELECT count(*) FROM pg_stat_activity) - 2)"
2424

25-
if PARALLEL_CONN=`psql -d ${PGDATABASE:-postgres} -qtc "$COMMAND" 2> /dev/null`; then
25+
if PARALLEL_CONN=`psql -d ${PGDATABASE:-postgres} -P pager=off -P tuples_only=true -qAXtc "$COMMAND" 2> /dev/null`; then
2626
if [ $PARALLEL_CONN -ge 1 ] 2>/dev/null; then
2727
# We know it's a number at this point
2828
[ $PARALLEL_CONN -eq 1 ] && error "NOTICE: unable to run tests in parallel; not enough connections"

0 commit comments

Comments
 (0)