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

Commita81edd4

Browse files
author
Ekaterina Sokolova
committed
Update TPC-DS tests
1) Enable TPC-DS tests2) Added the ability to crash when calling function pg_query_state3) Fix path to library in venv4) Disable requiring Travis tests to be run for unsupported versions
1 parenta5afb51 commita81edd4

File tree

4 files changed

+50
-18
lines changed

4 files changed

+50
-18
lines changed

‎.travis.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,22 @@ notifications:
2222
on_failure:always
2323

2424
env:
25-
-PG_VERSION=16 LEVEL=hardcore USE_TPCDS=0
25+
-PG_VERSION=16 LEVEL=hardcore USE_TPCDS=1
2626
-PG_VERSION=16
27-
-PG_VERSION=15 LEVEL=hardcore USE_TPCDS=0
27+
-PG_VERSION=15 LEVEL=hardcore USE_TPCDS=1
2828
-PG_VERSION=15
29-
-PG_VERSION=14 LEVEL=hardcore USE_TPCDS=0
29+
-PG_VERSION=14 LEVEL=hardcore USE_TPCDS=1
3030
-PG_VERSION=14
31-
-PG_VERSION=13 LEVEL=hardcore USE_TPCDS=0
31+
-PG_VERSION=13 LEVEL=hardcore USE_TPCDS=1
3232
-PG_VERSION=13
33-
-PG_VERSION=12 LEVEL=hardcore USE_TPCDS=0
33+
-PG_VERSION=12 LEVEL=hardcore USE_TPCDS=1
3434
-PG_VERSION=12
35-
-PG_VERSION=11 LEVEL=hardcore USE_TPCDS=0
3635
-PG_VERSION=11
37-
-PG_VERSION=10 LEVEL=hardcore USE_TPCDS=0
3836
-PG_VERSION=10
39-
-PG_VERSION=9.6 LEVEL=hardcore
4037
-PG_VERSION=9.6
4138

4239
matrix:
4340
allow_failures:
44-
-env:PG_VERSION=10 LEVEL=nightmare
45-
-env:PG_VERSION=9.6 LEVEL=nightmare
41+
-env:PG_VERSION=11
42+
-env:PG_VERSION=10
43+
-env:PG_VERSION=9.6

‎run_tests.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
set -ux
1414
status=0
1515

16+
venv_path=tmp/env
17+
rm -rf"$venv_path"
18+
1619
# global exports
1720
export PGPORT=55435
1821
export VIRTUAL_ENV_DISABLE_PROMPT=1
@@ -148,13 +151,14 @@ if [ -f regression.diffs ]; then cat regression.diffs; fi
148151

149152
# run python tests
150153
set +x -e
151-
python3 -m venv /tmp/env&&source /tmp/env/bin/activate&&
152-
pip install -r ./tests/requirements.txt
154+
python3 -m venv"$venv_path"&&source"$venv_path/bin/activate"
155+
pip3 install --upgrade -t"$venv_path" -r ./tests/requirements.txt
156+
#pip3 install -e "./$venv_path"
153157
set -e#exit virtualenv with error code
154-
python tests/pg_qs_test_runner.py --port$PGPORT
158+
python3 tests/pg_qs_test_runner.py --port$PGPORT
155159
if [["$USE_TPCDS"=="1" ]];then
156-
python tests/pg_qs_test_runner.py --port$PGPORT --tpc-ds-setup
157-
python tests/pg_qs_test_runner.py --port$PGPORT --tpc-ds-run
160+
python3 tests/pg_qs_test_runner.py --port$PGPORT --tpc-ds-setup
161+
python3 tests/pg_qs_test_runner.py --port$PGPORT --tpc-ds-run
158162
fi
159163
deactivate
160164
set -x
@@ -179,4 +183,5 @@ gcov $CUSTOM_PG_SRC/contrib/pg_query_state/*.c $CUSTOM_PG_SRC/contrib/pg_query_s
179183
set +ux
180184

181185
# send coverage stats to Codecov
186+
export CODECOV_TOKEN=55ab7421-9277-45af-a329-d8b40db96b2a
182187
bash<(curl -s https://codecov.io/bash)

‎tests/pg_qs_test_runner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
importos
99
importsys
1010

11+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
12+
sys.path.append(os.path.abspath('tmp/env'))
13+
1114
importpsycopg2
1215

13-
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
1416
fromtest_casesimport*
1517
importtpcds
1618

‎tests/tpcds.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
importtime
99

1010
importprogressbar
11+
# This actually imports progressbar2 but `import progressbar2' itself doesn't work.
12+
# In case of problems with the progressbar/progressbar2, check that you have the
13+
# progressbar2 installed and the path to it or venv is specified.
14+
1115
importpsycopg2.extensions
1216

1317
importcommon
@@ -55,13 +59,13 @@ def run_tpcds(config):
5559
TPC_DS_STATEMENT_TIMEOUT=20000# statement_timeout in ms
5660

5761
print('Preparing TPC-DS queries...')
62+
err_count=0
5863
queries= []
5964
forquery_fileinsorted(os.listdir('tmp_stress/tpcds-result-reproduction/query_qualification/')):
6065
withopen('tmp_stress/tpcds-result-reproduction/query_qualification/%s'%query_file,'r')asf:
6166
queries.append(f.read())
6267

6368
acon,=common.n_async_connect(config)
64-
pid=acon.get_backend_pid()
6569

6670
print('Starting TPC-DS queries...')
6771
timeout_list= []
@@ -84,8 +88,25 @@ def run_tpcds(config):
8488
PG_QS_DELAY,BEFORE_GETTING_QS_DELAY=0.1,0.1
8589
BEFORE_GETTING_QS,GETTING_QS=range(2)
8690
state,n_first_getting_qs_retries=BEFORE_GETTING_QS,0
91+
92+
pg_qs_args= {
93+
'config':config,
94+
'pid':acon.get_backend_pid()
95+
}
96+
8797
whileTrue:
88-
result,notices=common.pg_query_state(config,pid)
98+
try:
99+
result,notices=common.pg_query_state(**pg_qs_args)
100+
exceptExceptionase:
101+
# do not consider the test failed if the "error in message
102+
# queue data transmitting" is received, this may happen with
103+
# some small probability, but if it happens too often it is
104+
# a problem, we will handle this case after the loop
105+
if"error in message queue data transmitting"ine.pgerror:
106+
err_count+=1
107+
else:
108+
raisee
109+
89110
# run state machine to determine the first getting of query state
90111
# and query finishing
91112
ifstate==BEFORE_GETTING_QS:
@@ -109,6 +130,12 @@ def run_tpcds(config):
109130
exceptpsycopg2.extensions.QueryCanceledError:
110131
timeout_list.append(i+1)
111132

133+
iferr_count>2:
134+
print("ERROR: error in message queue data transmitting")
135+
raise
136+
eliferr_count>0:
137+
print(err_count," times there was error in message queue data transmitting")
138+
112139
common.n_close((acon,))
113140

114141
iflen(timeout_list)>0:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp