2 @message |
assert
iter: no_use_svc
- gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
LOG DETAILS:
2024-11-26 08:50:07.347
2024-11-26 08:50:07.355 act = <firebird.qa.plugin.Action object at [hex]>
2024-11-26 08:50:07.361 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_12258/tmp_333be4bf.fbk')
2024-11-26 08:50:07.366 tmp_res = PosixPath('/var/tmp/qa_2024/test_12258/tmp_333be4bf.fdb')
2024-11-26 08:50:07.373 tmp_log = PosixPath('/var/tmp/qa_2024/test_12258/tmp_333be4bf.log')
2024-11-26 08:50:07.379 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-11-26 08:50:07.386
2024-11-26 08:50:07.393 @pytest.mark.version('>=5.0')
2024-11-26 08:50:07.401 def test_1(act: Action, tmp_fbk: Path, tmp_res: Path, tmp_log: Path, capsys):
2024-11-26 08:50:07.410
2024-11-26 08:50:07.421 max_parallel_wrk = -1
2024-11-26 08:50:07.428 with act.db.connect() as con:
2024-11-26 08:50:07.435 cur = con.cursor()
2024-11-26 08:50:07.445 cur.execute("select g.rdb$config_value from rdb$config g where upper(g.rdb$config_name) = upper('MaxParallelWorkers')")
2024-11-26 08:50:07.452 for r in cur:
2024-11-26 08:50:07.459 max_parallel_wrk = int(r[0])
2024-11-26 08:50:07.465
2024-11-26 08:50:07.472 assert max_parallel_wrk > 1, "Config parameter 'MaxParallelWorkers' must have value greater than 1"
2024-11-26 08:50:07.481
2024-11-26 08:50:07.489 act.gbak(switches=['-b', str(act.db.dsn), str(tmp_fbk)])
2024-11-26 08:50:07.495
2024-11-26 08:50:07.504 for iter in ('embedded', 'no_use_svc','using_svc'):
2024-11-26 08:50:07.510 with open(tmp_log,'w') as f:
2024-11-26 08:50:07.515 if iter == 'embedded':
2024-11-26 08:50:07.521 subprocess.call( [
2024-11-26 08:50:07.531 act.vars['gbak']
2024-11-26 08:50:07.538 ,'-rep'
2024-11-26 08:50:07.544 ,'-v'
2024-11-26 08:50:07.552 ,'-par', str(max_parallel_wrk+1)
2024-11-26 08:50:07.562 ,tmp_fbk
2024-11-26 08:50:07.568 ,tmp_res
2024-11-26 08:50:07.574 ]
2024-11-26 08:50:07.580 ,stdout = f, stderr = subprocess.STDOUT
2024-11-26 08:50:07.588 )
2024-11-26 08:50:07.595 elif iter == 'no_use_svc':
2024-11-26 08:50:07.601 subprocess.call( [
2024-11-26 08:50:07.606 act.vars['gbak']
2024-11-26 08:50:07.612 ,'-rep'
2024-11-26 08:50:07.620 ,'-user', act.db.user
2024-11-26 08:50:07.629 ,'-pass', act.db.password
2024-11-26 08:50:07.636 ,'-v'
2024-11-26 08:50:07.641 ,'-par', str(max_parallel_wrk+1)
2024-11-26 08:50:07.646 ,tmp_fbk
2024-11-26 08:50:07.651 ,'localhost:' + str(tmp_res)
2024-11-26 08:50:07.657 ]
2024-11-26 08:50:07.665 ,stdout = f, stderr = subprocess.STDOUT
2024-11-26 08:50:07.671 )
2024-11-26 08:50:07.680 else:
2024-11-26 08:50:07.688 subprocess.call( [
2024-11-26 08:50:07.694 act.vars['gbak']
2024-11-26 08:50:07.703 ,'-rep'
2024-11-26 08:50:07.711 ,'-user', act.db.user
2024-11-26 08:50:07.718 ,'-pass', act.db.password
2024-11-26 08:50:07.723 ,'-v'
2024-11-26 08:50:07.728 ,'-par', str(max_parallel_wrk+1)
2024-11-26 08:50:07.733 ,'-se', 'localhost:service_mgr'
2024-11-26 08:50:07.739 ,tmp_fbk
2024-11-26 08:50:07.746 ,tmp_res
2024-11-26 08:50:07.752 ]
2024-11-26 08:50:07.761 ,stdout = f, stderr = subprocess.STDOUT
2024-11-26 08:50:07.767 )
2024-11-26 08:50:07.773 print(f'iter: {iter}')
2024-11-26 08:50:07.779 with open(tmp_log,'r') as f:
2024-11-26 08:50:07.786 for line in f:
2024-11-26 08:50:07.792 print(line)
2024-11-26 08:50:07.797
2024-11-26 08:50:07.803 act.expected_stdout = f"""
2024-11-26 08:50:07.809 iter: {iter}
2024-11-26 08:50:07.815 gbak: WARNING:Wrong parallel workers value {max_parallel_wrk+1}, valid range are from 1 to {max_parallel_wrk}
2024-11-26 08:50:07.821 """
2024-11-26 08:50:07.829
2024-11-26 08:50:07.835 act.stdout = capsys.readouterr().out
2024-11-26 08:50:07.847 > assert act.clean_stdout == act.clean_expected_stdout
2024-11-26 08:50:07.854 E assert
2024-11-26 08:50:07.860 E iter: no_use_svc
2024-11-26 08:50:07.867 E - gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
2024-11-26 08:50:07.876
2024-11-26 08:50:07.883 tests/functional/tabloid/test_333be4bf.py:111: AssertionError
2024-11-26 08:50:07.889 ---------------------------- Captured stdout setup -----------------------------
2024-11-26 08:50:07.895 Creating db: localhost:/var/tmp/qa_2024/test_12258/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_12258/tmp_333be4bf.fbk')
tmp_res = PosixPath('/var/tmp/qa_2024/test_12258/tmp_333be4bf.fdb')
tmp_log = PosixPath('/var/tmp/qa_2024/test_12258/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
|