2 @message |
assert
iter: no_use_svc
- gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
LOG DETAILS:
2024-12-24 23:47:21.985
2024-12-24 23:47:21.991 act = <firebird.qa.plugin.Action object at [hex]>
2024-12-24 23:47:21.997 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_12264/tmp_333be4bf.fbk')
2024-12-24 23:47:22.003 tmp_res = PosixPath('/var/tmp/qa_2024/test_12264/tmp_333be4bf.fdb')
2024-12-24 23:47:22.008 tmp_log = PosixPath('/var/tmp/qa_2024/test_12264/tmp_333be4bf.log')
2024-12-24 23:47:22.014 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-12-24 23:47:22.020
2024-12-24 23:47:22.025 @pytest.mark.version('>=5.0')
2024-12-24 23:47:22.030 def test_1(act: Action, tmp_fbk: Path, tmp_res: Path, tmp_log: Path, capsys):
2024-12-24 23:47:22.036
2024-12-24 23:47:22.042 max_parallel_wrk = -1
2024-12-24 23:47:22.048 with act.db.connect() as con:
2024-12-24 23:47:22.053 cur = con.cursor()
2024-12-24 23:47:22.058 cur.execute("select g.rdb$config_value from rdb$config g where upper(g.rdb$config_name) = upper('MaxParallelWorkers')")
2024-12-24 23:47:22.063 for r in cur:
2024-12-24 23:47:22.068 max_parallel_wrk = int(r[0])
2024-12-24 23:47:22.073
2024-12-24 23:47:22.078 assert max_parallel_wrk > 1, "Config parameter 'MaxParallelWorkers' must have value greater than 1"
2024-12-24 23:47:22.083
2024-12-24 23:47:22.087 act.gbak(switches=['-b', str(act.db.dsn), str(tmp_fbk)])
2024-12-24 23:47:22.092
2024-12-24 23:47:22.097 for iter in ('embedded', 'no_use_svc','using_svc'):
2024-12-24 23:47:22.102 with open(tmp_log,'w') as f:
2024-12-24 23:47:22.107 if iter == 'embedded':
2024-12-24 23:47:22.118 subprocess.call( [
2024-12-24 23:47:22.126 act.vars['gbak']
2024-12-24 23:47:22.132 ,'-rep'
2024-12-24 23:47:22.137 ,'-v'
2024-12-24 23:47:22.142 ,'-par', str(max_parallel_wrk+1)
2024-12-24 23:47:22.147 ,tmp_fbk
2024-12-24 23:47:22.152 ,tmp_res
2024-12-24 23:47:22.158 ]
2024-12-24 23:47:22.164 ,stdout = f, stderr = subprocess.STDOUT
2024-12-24 23:47:22.171 )
2024-12-24 23:47:22.179 elif iter == 'no_use_svc':
2024-12-24 23:47:22.184 subprocess.call( [
2024-12-24 23:47:22.190 act.vars['gbak']
2024-12-24 23:47:22.195 ,'-rep'
2024-12-24 23:47:22.200 ,'-user', act.db.user
2024-12-24 23:47:22.205 ,'-pass', act.db.password
2024-12-24 23:47:22.210 ,'-v'
2024-12-24 23:47:22.216 ,'-par', str(max_parallel_wrk+1)
2024-12-24 23:47:22.221 ,tmp_fbk
2024-12-24 23:47:22.227 ,'localhost:' + str(tmp_res)
2024-12-24 23:47:22.232 ]
2024-12-24 23:47:22.238 ,stdout = f, stderr = subprocess.STDOUT
2024-12-24 23:47:22.245 )
2024-12-24 23:47:22.251 else:
2024-12-24 23:47:22.256 subprocess.call( [
2024-12-24 23:47:22.262 act.vars['gbak']
2024-12-24 23:47:22.271 ,'-rep'
2024-12-24 23:47:22.277 ,'-user', act.db.user
2024-12-24 23:47:22.282 ,'-pass', act.db.password
2024-12-24 23:47:22.288 ,'-v'
2024-12-24 23:47:22.295 ,'-par', str(max_parallel_wrk+1)
2024-12-24 23:47:22.300 ,'-se', 'localhost:service_mgr'
2024-12-24 23:47:22.306 ,tmp_fbk
2024-12-24 23:47:22.311 ,tmp_res
2024-12-24 23:47:22.319 ]
2024-12-24 23:47:22.326 ,stdout = f, stderr = subprocess.STDOUT
2024-12-24 23:47:22.332 )
2024-12-24 23:47:22.337 print(f'iter: {iter}')
2024-12-24 23:47:22.342 with open(tmp_log,'r') as f:
2024-12-24 23:47:22.349 for line in f:
2024-12-24 23:47:22.355 print(line)
2024-12-24 23:47:22.360
2024-12-24 23:47:22.366 act.expected_stdout = f"""
2024-12-24 23:47:22.372 iter: {iter}
2024-12-24 23:47:22.378 gbak: WARNING:Wrong parallel workers value {max_parallel_wrk+1}, valid range are from 1 to {max_parallel_wrk}
2024-12-24 23:47:22.383 """
2024-12-24 23:47:22.389
2024-12-24 23:47:22.394 act.stdout = capsys.readouterr().out
2024-12-24 23:47:22.400 > assert act.clean_stdout == act.clean_expected_stdout
2024-12-24 23:47:22.405 E assert
2024-12-24 23:47:22.410 E iter: no_use_svc
2024-12-24 23:47:22.415 E - gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
2024-12-24 23:47:22.420
2024-12-24 23:47:22.425 tests/functional/tabloid/test_333be4bf.py:111: AssertionError
2024-12-24 23:47:22.430 ---------------------------- Captured stdout setup -----------------------------
2024-12-24 23:47:22.435 Creating db: localhost:/var/tmp/qa_2024/test_12264/test.fdb [page_size=None, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
tmp_fbk = PosixPath('/var/tmp/qa_2024/test_12264/tmp_333be4bf.fbk')
tmp_res = PosixPath('/var/tmp/qa_2024/test_12264/tmp_333be4bf.fdb')
tmp_log = PosixPath('/var/tmp/qa_2024/test_12264/tmp_333be4bf.log')
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=5.0')
def test_1(act: Action, tmp_fbk: Path, tmp_res: Path, tmp_log: Path, capsys):
max_parallel_wrk = -1
with act.db.connect() as con:
cur = con.cursor()
cur.execute("select g.rdb$config_value from rdb$config g where upper(g.rdb$config_name) = upper('MaxParallelWorkers')")
for r in cur:
max_parallel_wrk = int(r[0])
assert max_parallel_wrk > 1, "Config parameter 'MaxParallelWorkers' must have value greater than 1"
act.gbak(switches=['-b', str(act.db.dsn), str(tmp_fbk)])
for iter in ('embedded', 'no_use_svc','using_svc'):
with open(tmp_log,'w') as f:
if iter == 'embedded':
subprocess.call( [
act.vars['gbak']
,'-rep'
,'-v'
,'-par', str(max_parallel_wrk+1)
,tmp_fbk
,tmp_res
]
,stdout = f, stderr = subprocess.STDOUT
)
elif iter == 'no_use_svc':
subprocess.call( [
act.vars['gbak']
,'-rep'
,'-user', act.db.user
,'-pass', act.db.password
,'-v'
,'-par', str(max_parallel_wrk+1)
,tmp_fbk
,'localhost:' + str(tmp_res)
]
,stdout = f, stderr = subprocess.STDOUT
)
else:
subprocess.call( [
act.vars['gbak']
,'-rep'
,'-user', act.db.user
,'-pass', act.db.password
,'-v'
,'-par', str(max_parallel_wrk+1)
,'-se', 'localhost:service_mgr'
,tmp_fbk
,tmp_res
]
,stdout = f, stderr = subprocess.STDOUT
)
print(f'iter: {iter}')
with open(tmp_log,'r') as f:
for line in f:
print(line)
act.expected_stdout = f"""
iter: {iter}
gbak: WARNING:Wrong parallel workers value {max_parallel_wrk+1}, valid range are from 1 to {max_parallel_wrk}
"""
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E iter: no_use_svc
E - gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
tests/functional/tabloid/test_333be4bf.py:111: AssertionError
|