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

Commit42ce25b

Browse files
committed
Fix python tests for pg10
1 parentb587e48 commit42ce25b

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

‎tests/python/partitioning_test.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
importsubprocess
1717
importthreading
1818

19-
fromtestgresimportget_new_node,stop_all
19+
fromtestgresimportget_new_node,stop_all,get_config
2020

21+
version=get_config().get("VERSION_NUM")
2122

2223
# Helper function for json equality
2324
defordered(obj):
@@ -68,11 +69,17 @@ def init_test_data(self, node):
6869

6970
defcatchup_replica(self,master,replica):
7071
"""Wait until replica synchronizes with master"""
71-
master.poll_query_until(
72-
'postgres',
73-
'SELECT pg_current_xlog_location() <= replay_location '
74-
'FROM pg_stat_replication WHERE application_name =\'%s\''
75-
%replica.name)
72+
ifversion>=100000:
73+
wait_lsn_query= \
74+
'SELECT pg_current_wal_lsn() <= replay_lsn ' \
75+
'FROM pg_stat_replication WHERE application_name =\'%s\'' \
76+
%replica.name
77+
else:
78+
wait_lsn_query= \
79+
'SELECT pg_current_xlog_location() <= replay_location ' \
80+
'FROM pg_stat_replication WHERE application_name =\'%s\'' \
81+
%replica.name
82+
master.poll_query_until('postgres',wait_lsn_query)
7683

7784
defprintlog(self,logfile):
7885
withopen(logfile,'r')aslog:
@@ -482,7 +489,6 @@ def test_parallel_nodes(self):
482489

483490
# Check version of postgres server
484491
# If version < 9.6 skip all tests for parallel queries
485-
version=int(node.psql("postgres","show server_version_num")[1])
486492
ifversion<90600:
487493
return
488494

@@ -512,7 +518,10 @@ def test_parallel_nodes(self):
512518
# Test parallel select
513519
withnode.connect()ascon:
514520
con.execute('set max_parallel_workers_per_gather = 2')
515-
con.execute('set min_parallel_relation_size = 0')
521+
ifversion>=100000:
522+
con.execute('set min_parallel_table_scan_size = 0')
523+
else:
524+
con.execute('set min_parallel_relation_size = 0')
516525
con.execute('set parallel_setup_cost = 0')
517526
con.execute('set parallel_tuple_cost = 0')
518527

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp