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

Commit4f49dde

Browse files
TestTestgresCommon.test_pgbench is added
- [del] TestTestgresLocal.test_pgbench- [del] TestTestgresRemote.test_pgbench
1 parent110947d commit4f49dde

File tree

3 files changed

+21
-37
lines changed

3 files changed

+21
-37
lines changed

‎tests/test_testgres_common.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
importuuid
3939
importos
4040
importre
41+
importsubprocess
4142

4243

4344
@contextmanager
@@ -1100,6 +1101,26 @@ def test_get_pg_config2(self, node_svc: PostgresNodeService):
11001101
b=get_pg_config2(node_svc.os_ops,None)
11011102
assert (id(a)!=id(b))
11021103

1104+
deftest_pgbench(self,node_svc:PostgresNodeService):
1105+
assertisinstance(node_svc,PostgresNodeService)
1106+
1107+
__class__.helper__skip_test_if_util_not_exist(node_svc.os_ops,"pgbench")
1108+
1109+
with__class__.helper__get_node(node_svc).init().start()asnode:
1110+
# initialize pgbench DB and run benchmarks
1111+
node.pgbench_init(
1112+
scale=2,
1113+
foreign_keys=True,
1114+
options=['-q']
1115+
).pgbench_run(time=2)
1116+
1117+
# run TPC-B benchmark
1118+
proc=node.pgbench(stdout=subprocess.PIPE,
1119+
stderr=subprocess.STDOUT,
1120+
options=['-T3'])
1121+
out=proc.communicate()[0]
1122+
assert (b'tps = 'inout)
1123+
11031124
@staticmethod
11041125
defhelper__get_node(node_svc:PostgresNodeService,name=None):
11051126
assertisinstance(node_svc,PostgresNodeService)

‎tests/test_testgres_local.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,6 @@ def test_custom_init(self):
100100
# there should be no trust entries at all
101101
assertnot (any('trust'insforsinlines))
102102

103-
deftest_pgbench(self):
104-
__class__.helper__skip_test_if_util_not_exist("pgbench")
105-
106-
withget_new_node().init().start()asnode:
107-
108-
# initialize pgbench DB and run benchmarks
109-
node.pgbench_init(scale=2,foreign_keys=True,
110-
options=['-q']).pgbench_run(time=2)
111-
112-
# run TPC-B benchmark
113-
proc=node.pgbench(stdout=subprocess.PIPE,
114-
stderr=subprocess.STDOUT,
115-
options=['-T3'])
116-
117-
out,_=proc.communicate()
118-
out=out.decode('utf-8')
119-
120-
proc.stdout.close()
121-
122-
assert ('tps'inout)
123-
124103
deftest_pg_config(self):
125104
# check same instances
126105
a=get_pg_config()

‎tests/test_testgres_remote.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# coding: utf-8
22
importos
33
importre
4-
importsubprocess
54

65
importpytest
76
importlogging
@@ -169,21 +168,6 @@ def test_init__unk_LANG_and_LC_CTYPE(self):
169168
__class__.helper__restore_envvar("LC_CTYPE",prev_LC_CTYPE)
170169
__class__.helper__restore_envvar("LC_COLLATE",prev_LC_COLLATE)
171170

172-
deftest_pgbench(self):
173-
__class__.helper__skip_test_if_util_not_exist("pgbench")
174-
175-
with__class__.helper__get_node().init().start()asnode:
176-
# initialize pgbench DB and run benchmarks
177-
node.pgbench_init(scale=2,foreign_keys=True,
178-
options=['-q']).pgbench_run(time=2)
179-
180-
# run TPC-B benchmark
181-
proc=node.pgbench(stdout=subprocess.PIPE,
182-
stderr=subprocess.STDOUT,
183-
options=['-T3'])
184-
out=proc.communicate()[0]
185-
assert (b'tps = 'inout)
186-
187171
deftest_pg_config(self):
188172
# check same instances
189173
a=get_pg_config()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp