2 @message |
assert
iter: no_use_svc
- gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
LOG DETAILS:
2025-07-03 14:22:06.103
2025-07-03 14:22:06.110 act = <firebird.qa.plugin.Action object at [hex]>
2025-07-03 14:22:06.117 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_12335/tmp_333be4bf.fbk')
2025-07-03 14:22:06.123 tmp_res = PosixPath('/var/tmp/qa_2024/test_12335/tmp_333be4bf.fdb')
2025-07-03 14:22:06.129 tmp_log = PosixPath('/var/tmp/qa_2024/test_12335/tmp_333be4bf.log')
2025-07-03 14:22:06.135 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-07-03 14:22:06.141
2025-07-03 14:22:06.155 @pytest.mark.version('>=5.0')
2025-07-03 14:22:06.164 def test_1(act: Action, tmp_fbk: Path, tmp_res: Path, tmp_log: Path, capsys):
2025-07-03 14:22:06.171
2025-07-03 14:22:06.179 max_parallel_wrk = -1
2025-07-03 14:22:06.186 with act.db.connect() as con:
2025-07-03 14:22:06.191 cur = con.cursor()
2025-07-03 14:22:06.197 cur.execute("select g.rdb$config_value from rdb$config g where upper(g.rdb$config_name) = upper('MaxParallelWorkers')")
2025-07-03 14:22:06.203 for r in cur:
2025-07-03 14:22:06.209 max_parallel_wrk = int(r[0])
2025-07-03 14:22:06.215
2025-07-03 14:22:06.222 assert max_parallel_wrk > 1, "Config parameter 'MaxParallelWorkers' must have value greater than 1"
2025-07-03 14:22:06.228
2025-07-03 14:22:06.235 act.gbak(switches=['-b', str(act.db.dsn), str(tmp_fbk)])
2025-07-03 14:22:06.241
2025-07-03 14:22:06.248 for iter in ('embedded', 'no_use_svc','using_svc'):
2025-07-03 14:22:06.255 with open(tmp_log,'w') as f:
2025-07-03 14:22:06.262 if iter == 'embedded':
2025-07-03 14:22:06.271 subprocess.call( [
2025-07-03 14:22:06.279 act.vars['gbak']
2025-07-03 14:22:06.284 ,'-rep'
2025-07-03 14:22:06.291 ,'-v'
2025-07-03 14:22:06.297 ,'-par', str(max_parallel_wrk+1)
2025-07-03 14:22:06.304 ,tmp_fbk
2025-07-03 14:22:06.311 ,tmp_res
2025-07-03 14:22:06.317 ]
2025-07-03 14:22:06.330 ,stdout = f, stderr = subprocess.STDOUT
2025-07-03 14:22:06.342 )
2025-07-03 14:22:06.350 elif iter == 'no_use_svc':
2025-07-03 14:22:06.359 subprocess.call( [
2025-07-03 14:22:06.371 act.vars['gbak']
2025-07-03 14:22:06.381 ,'-rep'
2025-07-03 14:22:06.389 ,'-user', act.db.user
2025-07-03 14:22:06.396 ,'-pass', act.db.password
2025-07-03 14:22:06.400 ,'-v'
2025-07-03 14:22:06.405 ,'-par', str(max_parallel_wrk+1)
2025-07-03 14:22:06.411 ,tmp_fbk
2025-07-03 14:22:06.416 ,'localhost:' + str(tmp_res)
2025-07-03 14:22:06.421 ]
2025-07-03 14:22:06.431 ,stdout = f, stderr = subprocess.STDOUT
2025-07-03 14:22:06.439 )
2025-07-03 14:22:06.448 else:
2025-07-03 14:22:06.456 subprocess.call( [
2025-07-03 14:22:06.462 act.vars['gbak']
2025-07-03 14:22:06.473 ,'-rep'
2025-07-03 14:22:06.484 ,'-user', act.db.user
2025-07-03 14:22:06.495 ,'-pass', act.db.password
2025-07-03 14:22:06.506 ,'-v'
2025-07-03 14:22:06.518 ,'-par', str(max_parallel_wrk+1)
2025-07-03 14:22:06.527 ,'-se', 'localhost:service_mgr'
2025-07-03 14:22:06.536 ,tmp_fbk
2025-07-03 14:22:06.542 ,tmp_res
2025-07-03 14:22:06.554 ]
2025-07-03 14:22:06.564 ,stdout = f, stderr = subprocess.STDOUT
2025-07-03 14:22:06.571 )
2025-07-03 14:22:06.578 print(f'iter: {iter}')
2025-07-03 14:22:06.584 with open(tmp_log,'r') as f:
2025-07-03 14:22:06.590 for line in f:
2025-07-03 14:22:06.596 print(line)
2025-07-03 14:22:06.602
2025-07-03 14:22:06.607 act.expected_stdout = f"""
2025-07-03 14:22:06.614 iter: {iter}
2025-07-03 14:22:06.626 gbak: WARNING:Wrong parallel workers value {max_parallel_wrk+1}, valid range are from 1 to {max_parallel_wrk}
2025-07-03 14:22:06.634 """
2025-07-03 14:22:06.641
2025-07-03 14:22:06.652 act.stdout = capsys.readouterr().out
2025-07-03 14:22:06.663 > assert act.clean_stdout == act.clean_expected_stdout
2025-07-03 14:22:06.675 E assert
2025-07-03 14:22:06.686 E iter: no_use_svc
2025-07-03 14:22:06.696 E - gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
2025-07-03 14:22:06.709
2025-07-03 14:22:06.718 tests/functional/tabloid/test_333be4bf.py:111: AssertionError
2025-07-03 14:22:06.731 ---------------------------- Captured stdout setup -----------------------------
2025-07-03 14:22:06.745 Creating db: localhost:/var/tmp/qa_2024/test_12335/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_12335/tmp_333be4bf.fbk')
tmp_res = PosixPath('/var/tmp/qa_2024/test_12335/tmp_333be4bf.fdb')
tmp_log = PosixPath('/var/tmp/qa_2024/test_12335/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
|