2 @message |
assert
iter: no_use_svc
- gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
LOG DETAILS:
2024-10-23 11:08:34.487
2024-10-23 11:08:34.496 act = <firebird.qa.plugin.Action object at [hex]>
2024-10-23 11:08:34.503 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_12240/tmp_333be4bf.fbk')
2024-10-23 11:08:34.510 tmp_res = PosixPath('/var/tmp/qa_2024/test_12240/tmp_333be4bf.fdb')
2024-10-23 11:08:34.518 tmp_log = PosixPath('/var/tmp/qa_2024/test_12240/tmp_333be4bf.log')
2024-10-23 11:08:34.523 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-10-23 11:08:34.529
2024-10-23 11:08:34.534 @pytest.mark.version('>=5.0')
2024-10-23 11:08:34.543 def test_1(act: Action, tmp_fbk: Path, tmp_res: Path, tmp_log: Path, capsys):
2024-10-23 11:08:34.550
2024-10-23 11:08:34.555 max_parallel_wrk = -1
2024-10-23 11:08:34.560 with act.db.connect() as con:
2024-10-23 11:08:34.565 cur = con.cursor()
2024-10-23 11:08:34.571 cur.execute("select g.rdb$config_value from rdb$config g where upper(g.rdb$config_name) = upper('MaxParallelWorkers')")
2024-10-23 11:08:34.577 for r in cur:
2024-10-23 11:08:34.583 max_parallel_wrk = int(r[0])
2024-10-23 11:08:34.589
2024-10-23 11:08:34.596 assert max_parallel_wrk > 1, "Config parameter 'MaxParallelWorkers' must have value greater than 1"
2024-10-23 11:08:34.602
2024-10-23 11:08:34.609 act.gbak(switches=['-b', str(act.db.dsn), str(tmp_fbk)])
2024-10-23 11:08:34.615
2024-10-23 11:08:34.622 for iter in ('embedded', 'no_use_svc','using_svc'):
2024-10-23 11:08:34.631 with open(tmp_log,'w') as f:
2024-10-23 11:08:34.638 if iter == 'embedded':
2024-10-23 11:08:34.645 subprocess.call( [
2024-10-23 11:08:34.651 act.vars['gbak']
2024-10-23 11:08:34.657 ,'-rep'
2024-10-23 11:08:34.662 ,'-v'
2024-10-23 11:08:34.669 ,'-par', str(max_parallel_wrk+1)
2024-10-23 11:08:34.675 ,tmp_fbk
2024-10-23 11:08:34.681 ,tmp_res
2024-10-23 11:08:34.688 ]
2024-10-23 11:08:34.694 ,stdout = f, stderr = subprocess.STDOUT
2024-10-23 11:08:34.699 )
2024-10-23 11:08:34.704 elif iter == 'no_use_svc':
2024-10-23 11:08:34.709 subprocess.call( [
2024-10-23 11:08:34.715 act.vars['gbak']
2024-10-23 11:08:34.720 ,'-rep'
2024-10-23 11:08:34.725 ,'-user', act.db.user
2024-10-23 11:08:34.730 ,'-pass', act.db.password
2024-10-23 11:08:34.735 ,'-v'
2024-10-23 11:08:34.741 ,'-par', str(max_parallel_wrk+1)
2024-10-23 11:08:34.746 ,tmp_fbk
2024-10-23 11:08:34.758 ,'localhost:' + str(tmp_res)
2024-10-23 11:08:34.764 ]
2024-10-23 11:08:34.770 ,stdout = f, stderr = subprocess.STDOUT
2024-10-23 11:08:34.776 )
2024-10-23 11:08:34.781 else:
2024-10-23 11:08:34.786 subprocess.call( [
2024-10-23 11:08:34.791 act.vars['gbak']
2024-10-23 11:08:34.796 ,'-rep'
2024-10-23 11:08:34.801 ,'-user', act.db.user
2024-10-23 11:08:34.806 ,'-pass', act.db.password
2024-10-23 11:08:34.810 ,'-v'
2024-10-23 11:08:34.815 ,'-par', str(max_parallel_wrk+1)
2024-10-23 11:08:34.822 ,'-se', 'localhost:service_mgr'
2024-10-23 11:08:34.830 ,tmp_fbk
2024-10-23 11:08:34.835 ,tmp_res
2024-10-23 11:08:34.840 ]
2024-10-23 11:08:34.846 ,stdout = f, stderr = subprocess.STDOUT
2024-10-23 11:08:34.852 )
2024-10-23 11:08:34.858 print(f'iter: {iter}')
2024-10-23 11:08:34.864 with open(tmp_log,'r') as f:
2024-10-23 11:08:34.871 for line in f:
2024-10-23 11:08:34.878 print(line)
2024-10-23 11:08:34.883
2024-10-23 11:08:34.890 act.expected_stdout = f"""
2024-10-23 11:08:34.898 iter: {iter}
2024-10-23 11:08:34.904 gbak: WARNING:Wrong parallel workers value {max_parallel_wrk+1}, valid range are from 1 to {max_parallel_wrk}
2024-10-23 11:08:34.911 """
2024-10-23 11:08:34.916
2024-10-23 11:08:34.921 act.stdout = capsys.readouterr().out
2024-10-23 11:08:34.926 > assert act.clean_stdout == act.clean_expected_stdout
2024-10-23 11:08:34.930 E assert
2024-10-23 11:08:34.936 E iter: no_use_svc
2024-10-23 11:08:34.941 E - gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
2024-10-23 11:08:34.946
2024-10-23 11:08:34.952 tests/functional/tabloid/test_333be4bf.py:111: AssertionError
2024-10-23 11:08:34.957 ---------------------------- Captured stdout setup -----------------------------
2024-10-23 11:08:34.962 Creating db: localhost:/var/tmp/qa_2024/test_12240/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_12240/tmp_333be4bf.fbk')
tmp_res = PosixPath('/var/tmp/qa_2024/test_12240/tmp_333be4bf.fdb')
tmp_log = PosixPath('/var/tmp/qa_2024/test_12240/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
|