11'''
22test_cases.py
3- Copyright (c) 2016-2019 , Postgres Professional
3+ Copyright (c) 2016-2020 , Postgres Professional
44'''
55
6- import common
76import os
8- import progressbar
9- import psycopg2 .extensions
107import subprocess
118import time
129
10+ import progressbar
11+ import psycopg2 .extensions
12+
13+ import common
14+
1315class DataLoadException (Exception ): pass
1416class 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-
1918def 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