1
1
'''
2
2
test_cases.py
3
- Copyright (c) 2016-2019 , Postgres Professional
3
+ Copyright (c) 2016-2020 , Postgres Professional
4
4
'''
5
5
6
- import common
7
6
import os
8
- import progressbar
9
- import psycopg2 .extensions
10
7
import subprocess
11
8
import time
12
9
10
+ import progressbar
11
+ import psycopg2 .extensions
12
+
13
+ import common
14
+
13
15
class DataLoadException (Exception ): pass
14
16
class StressTestException (Exception ): pass
15
17
16
- TPC_DS_EXCLUDE_LIST = [] # actual numbers of TPC-DS tests to exclude
17
- TPC_DS_STATEMENT_TIMEOUT = 20000 # statement_timeout in ms
18
-
19
18
def setup_tpcds (config ):
20
19
print ('Setting up TPC-DS test...' )
21
20
subprocess .call (['./tests/prepare_stress.sh' ])
@@ -62,6 +61,7 @@ def run_tpcds(config):
62
61
pid = acon .get_backend_pid ()
63
62
64
63
print ('Starting TPC-DS queries...' )
64
+ TPC_DS_EXCLUDE_LIST = [] # actual numbers of TPC-DS tests to exclude
65
65
timeout_list = []
66
66
bar = progressbar .ProgressBar (max_value = len (queries ))
67
67
for i , query in enumerate (queries ):
@@ -70,6 +70,7 @@ def run_tpcds(config):
70
70
continue
71
71
try :
72
72
# Set query timeout to TPC_DS_STATEMENT_TIMEOUT / 1000 seconds
73
+ TPC_DS_STATEMENT_TIMEOUT = 20000
73
74
common .set_guc (acon , 'statement_timeout' , TPC_DS_STATEMENT_TIMEOUT )
74
75
75
76
# run query
@@ -84,7 +85,7 @@ def run_tpcds(config):
84
85
state , n_first_getting_qs_retries = BEFORE_GETTING_QS , 0
85
86
while True :
86
87
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
88
89
# and query finishing
89
90
if state == BEFORE_GETTING_QS :
90
91
if len (result ) > 0 or common .BACKEND_IS_ACTIVE_INFO in notices :
0 commit comments