@@ -98,10 +98,19 @@ def pg_query_state(config, pid, verbose=False, costs=False, timing=False, \
9898
9999conn = psycopg2 .connect (** config )
100100curs = conn .cursor ()
101+ set_guc (conn ,'statement_timeout' ,10000 )
102+
101103result = []
104+ n_retries = 0
102105while not result :
103106curs .callproc ('pg_query_state' , (pid ,verbose ,costs ,timing ,buffers ,triggers ,format ))
104107result = curs .fetchall ()
108+ n_retries += 1
109+
110+ if n_retries == 25 :
111+ print ('pg_query_state tried 25 times with no effect' )
112+ break
113+
105114notices = conn .notices [:]
106115conn .close ()
107116return result
@@ -544,7 +553,8 @@ def stress_test(config):
544553
545554print ('Preparing TPC-DS queries...' )
546555# Execute query in separate thread
547- with open ('tmp_stress/tpcds-kit/tools/query_0.sql' ,'r' )as f :
556+ # with open('tmp_stress/tpcds-kit/tools/query_0.sql', 'r') as f:
557+ with open ('tests/query_tpcds.sql' ,'r' )as f :
548558sql = f .read ()
549559
550560queries = sql .split (';' )
@@ -557,7 +567,7 @@ def stress_test(config):
557567
558568print ('Starting test...' )
559569timeout_list = []
560- exclude_list = [2 ]
570+ exclude_list = []
561571bar = progressbar .ProgressBar (max_value = len (queries ))
562572for i ,query in enumerate (queries ):
563573bar .update (i + 1 )