2 @message |
assert
iter: no_use_svc
- gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
LOG DETAILS:
2025-06-27 15:45:51.033
2025-06-27 15:45:51.039 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-27 15:45:51.045 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_12327/tmp_333be4bf.fbk')
2025-06-27 15:45:51.051 tmp_res = PosixPath('/var/tmp/qa_2024/test_12327/tmp_333be4bf.fdb')
2025-06-27 15:45:51.059 tmp_log = PosixPath('/var/tmp/qa_2024/test_12327/tmp_333be4bf.log')
2025-06-27 15:45:51.071 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-27 15:45:51.080
2025-06-27 15:45:51.088 @pytest.mark.version('>=5.0')
2025-06-27 15:45:51.101 def test_1(act: Action, tmp_fbk: Path, tmp_res: Path, tmp_log: Path, capsys):
2025-06-27 15:45:51.111
2025-06-27 15:45:51.122 max_parallel_wrk = -1
2025-06-27 15:45:51.131 with act.db.connect() as con:
2025-06-27 15:45:51.138 cur = con.cursor()
2025-06-27 15:45:51.144 cur.execute("select g.rdb$config_value from rdb$config g where upper(g.rdb$config_name) = upper('MaxParallelWorkers')")
2025-06-27 15:45:51.155 for r in cur:
2025-06-27 15:45:51.161 max_parallel_wrk = int(r[0])
2025-06-27 15:45:51.167
2025-06-27 15:45:51.172 assert max_parallel_wrk > 1, "Config parameter 'MaxParallelWorkers' must have value greater than 1"
2025-06-27 15:45:51.178
2025-06-27 15:45:51.185 act.gbak(switches=['-b', str(act.db.dsn), str(tmp_fbk)])
2025-06-27 15:45:51.192
2025-06-27 15:45:51.198 for iter in ('embedded', 'no_use_svc','using_svc'):
2025-06-27 15:45:51.206 with open(tmp_log,'w') as f:
2025-06-27 15:45:51.213 if iter == 'embedded':
2025-06-27 15:45:51.219 subprocess.call( [
2025-06-27 15:45:51.225 act.vars['gbak']
2025-06-27 15:45:51.237 ,'-rep'
2025-06-27 15:45:51.246 ,'-v'
2025-06-27 15:45:51.255 ,'-par', str(max_parallel_wrk+1)
2025-06-27 15:45:51.268 ,tmp_fbk
2025-06-27 15:45:51.276 ,tmp_res
2025-06-27 15:45:51.289 ]
2025-06-27 15:45:51.300 ,stdout = f, stderr = subprocess.STDOUT
2025-06-27 15:45:51.311 )
2025-06-27 15:45:51.322 elif iter == 'no_use_svc':
2025-06-27 15:45:51.332 subprocess.call( [
2025-06-27 15:45:51.339 act.vars['gbak']
2025-06-27 15:45:51.349 ,'-rep'
2025-06-27 15:45:51.360 ,'-user', act.db.user
2025-06-27 15:45:51.370 ,'-pass', act.db.password
2025-06-27 15:45:51.382 ,'-v'
2025-06-27 15:45:51.394 ,'-par', str(max_parallel_wrk+1)
2025-06-27 15:45:51.404 ,tmp_fbk
2025-06-27 15:45:51.412 ,'localhost:' + str(tmp_res)
2025-06-27 15:45:51.419 ]
2025-06-27 15:45:51.426 ,stdout = f, stderr = subprocess.STDOUT
2025-06-27 15:45:51.436 )
2025-06-27 15:45:51.445 else:
2025-06-27 15:45:51.452 subprocess.call( [
2025-06-27 15:45:51.459 act.vars['gbak']
2025-06-27 15:45:51.472 ,'-rep'
2025-06-27 15:45:51.483 ,'-user', act.db.user
2025-06-27 15:45:51.492 ,'-pass', act.db.password
2025-06-27 15:45:51.500 ,'-v'
2025-06-27 15:45:51.507 ,'-par', str(max_parallel_wrk+1)
2025-06-27 15:45:51.514 ,'-se', 'localhost:service_mgr'
2025-06-27 15:45:51.520 ,tmp_fbk
2025-06-27 15:45:51.525 ,tmp_res
2025-06-27 15:45:51.529 ]
2025-06-27 15:45:51.534 ,stdout = f, stderr = subprocess.STDOUT
2025-06-27 15:45:51.539 )
2025-06-27 15:45:51.546 print(f'iter: {iter}')
2025-06-27 15:45:51.551 with open(tmp_log,'r') as f:
2025-06-27 15:45:51.563 for line in f:
2025-06-27 15:45:51.573 print(line)
2025-06-27 15:45:51.585
2025-06-27 15:45:51.598 act.expected_stdout = f"""
2025-06-27 15:45:51.610 iter: {iter}
2025-06-27 15:45:51.621 gbak: WARNING:Wrong parallel workers value {max_parallel_wrk+1}, valid range are from 1 to {max_parallel_wrk}
2025-06-27 15:45:51.632 """
2025-06-27 15:45:51.643
2025-06-27 15:45:51.651 act.stdout = capsys.readouterr().out
2025-06-27 15:45:51.659 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-27 15:45:51.667 E assert
2025-06-27 15:45:51.674 E iter: no_use_svc
2025-06-27 15:45:51.680 E - gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
2025-06-27 15:45:51.686
2025-06-27 15:45:51.692 tests/functional/tabloid/test_333be4bf.py:111: AssertionError
2025-06-27 15:45:51.703 ---------------------------- Captured stdout setup -----------------------------
2025-06-27 15:45:51.713 Creating db: localhost:/var/tmp/qa_2024/test_12327/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_12327/tmp_333be4bf.fbk')
tmp_res = PosixPath('/var/tmp/qa_2024/test_12327/tmp_333be4bf.fdb')
tmp_log = PosixPath('/var/tmp/qa_2024/test_12327/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
|