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-01 16:25:59.156
2025-07-01 16:25:59.168 act = <firebird.qa.plugin.Action object at [hex]>
2025-07-01 16:25:59.176 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_12334/tmp_333be4bf.fbk')
2025-07-01 16:25:59.184 tmp_res = PosixPath('/var/tmp/qa_2024/test_12334/tmp_333be4bf.fdb')
2025-07-01 16:25:59.191 tmp_log = PosixPath('/var/tmp/qa_2024/test_12334/tmp_333be4bf.log')
2025-07-01 16:25:59.198 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-07-01 16:25:59.204
2025-07-01 16:25:59.211 @pytest.mark.version('>=5.0')
2025-07-01 16:25:59.220 def test_1(act: Action, tmp_fbk: Path, tmp_res: Path, tmp_log: Path, capsys):
2025-07-01 16:25:59.232
2025-07-01 16:25:59.241 max_parallel_wrk = -1
2025-07-01 16:25:59.248 with act.db.connect() as con:
2025-07-01 16:25:59.254 cur = con.cursor()
2025-07-01 16:25:59.260 cur.execute("select g.rdb$config_value from rdb$config g where upper(g.rdb$config_name) = upper('MaxParallelWorkers')")
2025-07-01 16:25:59.266 for r in cur:
2025-07-01 16:25:59.273 max_parallel_wrk = int(r[0])
2025-07-01 16:25:59.279
2025-07-01 16:25:59.284 assert max_parallel_wrk > 1, "Config parameter 'MaxParallelWorkers' must have value greater than 1"
2025-07-01 16:25:59.295
2025-07-01 16:25:59.304 act.gbak(switches=['-b', str(act.db.dsn), str(tmp_fbk)])
2025-07-01 16:25:59.312
2025-07-01 16:25:59.318 for iter in ('embedded', 'no_use_svc','using_svc'):
2025-07-01 16:25:59.324 with open(tmp_log,'w') as f:
2025-07-01 16:25:59.330 if iter == 'embedded':
2025-07-01 16:25:59.336 subprocess.call( [
2025-07-01 16:25:59.343 act.vars['gbak']
2025-07-01 16:25:59.351 ,'-rep'
2025-07-01 16:25:59.363 ,'-v'
2025-07-01 16:25:59.372 ,'-par', str(max_parallel_wrk+1)
2025-07-01 16:25:59.379 ,tmp_fbk
2025-07-01 16:25:59.385 ,tmp_res
2025-07-01 16:25:59.391 ]
2025-07-01 16:25:59.397 ,stdout = f, stderr = subprocess.STDOUT
2025-07-01 16:25:59.403 )
2025-07-01 16:25:59.411 elif iter == 'no_use_svc':
2025-07-01 16:25:59.420 subprocess.call( [
2025-07-01 16:25:59.427 act.vars['gbak']
2025-07-01 16:25:59.433 ,'-rep'
2025-07-01 16:25:59.438 ,'-user', act.db.user
2025-07-01 16:25:59.443 ,'-pass', act.db.password
2025-07-01 16:25:59.448 ,'-v'
2025-07-01 16:25:59.452 ,'-par', str(max_parallel_wrk+1)
2025-07-01 16:25:59.458 ,tmp_fbk
2025-07-01 16:25:59.464 ,'localhost:' + str(tmp_res)
2025-07-01 16:25:59.470 ]
2025-07-01 16:25:59.477 ,stdout = f, stderr = subprocess.STDOUT
2025-07-01 16:25:59.483 )
2025-07-01 16:25:59.491 else:
2025-07-01 16:25:59.502 subprocess.call( [
2025-07-01 16:25:59.512 act.vars['gbak']
2025-07-01 16:25:59.519 ,'-rep'
2025-07-01 16:25:59.525 ,'-user', act.db.user
2025-07-01 16:25:59.531 ,'-pass', act.db.password
2025-07-01 16:25:59.537 ,'-v'
2025-07-01 16:25:59.543 ,'-par', str(max_parallel_wrk+1)
2025-07-01 16:25:59.550 ,'-se', 'localhost:service_mgr'
2025-07-01 16:25:59.558 ,tmp_fbk
2025-07-01 16:25:59.570 ,tmp_res
2025-07-01 16:25:59.578 ]
2025-07-01 16:25:59.585 ,stdout = f, stderr = subprocess.STDOUT
2025-07-01 16:25:59.591 )
2025-07-01 16:25:59.596 print(f'iter: {iter}')
2025-07-01 16:25:59.601 with open(tmp_log,'r') as f:
2025-07-01 16:25:59.605 for line in f:
2025-07-01 16:25:59.610 print(line)
2025-07-01 16:25:59.616
2025-07-01 16:25:59.621 act.expected_stdout = f"""
2025-07-01 16:25:59.628 iter: {iter}
2025-07-01 16:25:59.635 gbak: WARNING:Wrong parallel workers value {max_parallel_wrk+1}, valid range are from 1 to {max_parallel_wrk}
2025-07-01 16:25:59.643 """
2025-07-01 16:25:59.650
2025-07-01 16:25:59.656 act.stdout = capsys.readouterr().out
2025-07-01 16:25:59.662 > assert act.clean_stdout == act.clean_expected_stdout
2025-07-01 16:25:59.668 E assert
2025-07-01 16:25:59.675 E iter: no_use_svc
2025-07-01 16:25:59.680 E - gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
2025-07-01 16:25:59.685
2025-07-01 16:25:59.690 tests/functional/tabloid/test_333be4bf.py:111: AssertionError
2025-07-01 16:25:59.695 ---------------------------- Captured stdout setup -----------------------------
2025-07-01 16:25:59.700 Creating db: localhost:/var/tmp/qa_2024/test_12334/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_12334/tmp_333be4bf.fbk')
tmp_res = PosixPath('/var/tmp/qa_2024/test_12334/tmp_333be4bf.fdb')
tmp_log = PosixPath('/var/tmp/qa_2024/test_12334/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
|