Skip to content

Commit c1776bc

Browse files
committed
Make light refactoring after review from ololobus
1 parent 61cf837 commit c1776bc

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

tests/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
common.py
3-
Copyright (c) 2016-2019, Postgres Professional
3+
Copyright (c) 2016-2020, Postgres Professional
44
'''
55

66
import psycopg2

tests/pg_qs_test_runner.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
'''
22
pg_qs_test_runner.py
3-
Copyright (c) 2016-2019, Postgres Professional
3+
Copyright (c) 2016-2020, Postgres Professional
44
'''
55

66
import argparse
77
import getpass
88
import os
9-
import psycopg2
109
import sys
1110

11+
import psycopg2
12+
1213
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
1314
from test_cases import *
1415
import tpcds

tests/test_cases.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
'''
22
test_cases.py
3-
Copyright (c) 2016-2019, Postgres Professional
3+
Copyright (c) 2016-2020, Postgres Professional
44
'''
55

6-
import common
76
import json
8-
import psycopg2
97
import re
108
import select
119
import time
1210
import xml.etree.ElementTree as ET
11+
12+
import psycopg2
1313
import yaml
1414

15+
import common
16+
1517
def test_deadlock(config):
1618
"""test when two backends try to extract state of each other"""
1719

tests/tpcds.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
'''
22
test_cases.py
3-
Copyright (c) 2016-2019, Postgres Professional
3+
Copyright (c) 2016-2020, Postgres Professional
44
'''
55

6-
import common
76
import os
8-
import progressbar
9-
import psycopg2.extensions
107
import subprocess
118
import time
129

10+
import progressbar
11+
import psycopg2.extensions
12+
13+
import common
14+
1315
class DataLoadException(Exception): pass
1416
class StressTestException(Exception): pass
1517

16-
TPC_DS_EXCLUDE_LIST = [] # actual numbers of TPC-DS tests to exclude
17-
TPC_DS_STATEMENT_TIMEOUT = 20000 # statement_timeout in ms
18-
1918
def setup_tpcds(config):
2019
print('Setting up TPC-DS test...')
2120
subprocess.call(['./tests/prepare_stress.sh'])
@@ -62,6 +61,7 @@ def run_tpcds(config):
6261
pid = acon.get_backend_pid()
6362

6463
print('Starting TPC-DS queries...')
64+
TPC_DS_EXCLUDE_LIST = [] # actual numbers of TPC-DS tests to exclude
6565
timeout_list = []
6666
bar = progressbar.ProgressBar(max_value=len(queries))
6767
for i, query in enumerate(queries):
@@ -70,6 +70,7 @@ def run_tpcds(config):
7070
continue
7171
try:
7272
# Set query timeout to TPC_DS_STATEMENT_TIMEOUT / 1000 seconds
73+
TPC_DS_STATEMENT_TIMEOUT = 20000
7374
common.set_guc(acon, 'statement_timeout', TPC_DS_STATEMENT_TIMEOUT)
7475

7576
# run query
@@ -84,7 +85,7 @@ def run_tpcds(config):
8485
state, n_first_getting_qs_retries = BEFORE_GETTING_QS, 0
8586
while True:
8687
result, notices = common.pg_query_state(config, pid)
87-
# run state machine to determine the first getting query state
88+
# run state machine to determine the first getting of query state
8889
# and query finishing
8990
if state == BEFORE_GETTING_QS:
9091
if len(result) > 0 or common.BACKEND_IS_ACTIVE_INFO in notices:

0 commit comments

Comments
 (0)