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-11 15:42:52.375
2025-06-11 15:42:52.386 act = <firebird.qa.plugin.Action object at [hex]>
2025-06-11 15:42:52.395 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_12308/tmp_333be4bf.fbk')
2025-06-11 15:42:52.402 tmp_res = PosixPath('/var/tmp/qa_2024/test_12308/tmp_333be4bf.fdb')
2025-06-11 15:42:52.410 tmp_log = PosixPath('/var/tmp/qa_2024/test_12308/tmp_333be4bf.log')
2025-06-11 15:42:52.420 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-06-11 15:42:52.427
2025-06-11 15:42:52.435 @pytest.mark.version('>=5.0')
2025-06-11 15:42:52.447 def test_1(act: Action, tmp_fbk: Path, tmp_res: Path, tmp_log: Path, capsys):
2025-06-11 15:42:52.458
2025-06-11 15:42:52.470 max_parallel_wrk = -1
2025-06-11 15:42:52.483 with act.db.connect() as con:
2025-06-11 15:42:52.494 cur = con.cursor()
2025-06-11 15:42:52.503 cur.execute("select g.rdb$config_value from rdb$config g where upper(g.rdb$config_name) = upper('MaxParallelWorkers')")
2025-06-11 15:42:52.511 for r in cur:
2025-06-11 15:42:52.518 max_parallel_wrk = int(r[0])
2025-06-11 15:42:52.524
2025-06-11 15:42:52.531 assert max_parallel_wrk > 1, "Config parameter 'MaxParallelWorkers' must have value greater than 1"
2025-06-11 15:42:52.537
2025-06-11 15:42:52.543 act.gbak(switches=['-b', str(act.db.dsn), str(tmp_fbk)])
2025-06-11 15:42:52.551
2025-06-11 15:42:52.561 for iter in ('embedded', 'no_use_svc','using_svc'):
2025-06-11 15:42:52.570 with open(tmp_log,'w') as f:
2025-06-11 15:42:52.578 if iter == 'embedded':
2025-06-11 15:42:52.592 subprocess.call( [
2025-06-11 15:42:52.606 act.vars['gbak']
2025-06-11 15:42:52.619 ,'-rep'
2025-06-11 15:42:52.632 ,'-v'
2025-06-11 15:42:52.646 ,'-par', str(max_parallel_wrk+1)
2025-06-11 15:42:52.657 ,tmp_fbk
2025-06-11 15:42:52.671 ,tmp_res
2025-06-11 15:42:52.683 ]
2025-06-11 15:42:52.692 ,stdout = f, stderr = subprocess.STDOUT
2025-06-11 15:42:52.700 )
2025-06-11 15:42:52.708 elif iter == 'no_use_svc':
2025-06-11 15:42:52.721 subprocess.call( [
2025-06-11 15:42:52.733 act.vars['gbak']
2025-06-11 15:42:52.740 ,'-rep'
2025-06-11 15:42:52.747 ,'-user', act.db.user
2025-06-11 15:42:52.756 ,'-pass', act.db.password
2025-06-11 15:42:52.766 ,'-v'
2025-06-11 15:42:52.773 ,'-par', str(max_parallel_wrk+1)
2025-06-11 15:42:52.780 ,tmp_fbk
2025-06-11 15:42:52.787 ,'localhost:' + str(tmp_res)
2025-06-11 15:42:52.795 ]
2025-06-11 15:42:52.809 ,stdout = f, stderr = subprocess.STDOUT
2025-06-11 15:42:52.818 )
2025-06-11 15:42:52.832 else:
2025-06-11 15:42:52.843 subprocess.call( [
2025-06-11 15:42:52.852 act.vars['gbak']
2025-06-11 15:42:52.859 ,'-rep'
2025-06-11 15:42:52.867 ,'-user', act.db.user
2025-06-11 15:42:52.874 ,'-pass', act.db.password
2025-06-11 15:42:52.885 ,'-v'
2025-06-11 15:42:52.895 ,'-par', str(max_parallel_wrk+1)
2025-06-11 15:42:52.903 ,'-se', 'localhost:service_mgr'
2025-06-11 15:42:52.917 ,tmp_fbk
2025-06-11 15:42:52.928 ,tmp_res
2025-06-11 15:42:52.937 ]
2025-06-11 15:42:52.948 ,stdout = f, stderr = subprocess.STDOUT
2025-06-11 15:42:52.962 )
2025-06-11 15:42:52.971 print(f'iter: {iter}')
2025-06-11 15:42:52.979 with open(tmp_log,'r') as f:
2025-06-11 15:42:52.987 for line in f:
2025-06-11 15:42:52.994 print(line)
2025-06-11 15:42:53.002
2025-06-11 15:42:53.015 act.expected_stdout = f"""
2025-06-11 15:42:53.028 iter: {iter}
2025-06-11 15:42:53.041 gbak: WARNING:Wrong parallel workers value {max_parallel_wrk+1}, valid range are from 1 to {max_parallel_wrk}
2025-06-11 15:42:53.051 """
2025-06-11 15:42:53.062
2025-06-11 15:42:53.072 act.stdout = capsys.readouterr().out
2025-06-11 15:42:53.080 > assert act.clean_stdout == act.clean_expected_stdout
2025-06-11 15:42:53.087 E assert
2025-06-11 15:42:53.095 E iter: no_use_svc
2025-06-11 15:42:53.106 E - gbak: WARNING:Wrong parallel workers value 3, valid range are from 1 to 2
2025-06-11 15:42:53.113
2025-06-11 15:42:53.123 tests/functional/tabloid/test_333be4bf.py:111: AssertionError
2025-06-11 15:42:53.133 ---------------------------- Captured stdout setup -----------------------------
2025-06-11 15:42:53.141 Creating db: localhost:/var/tmp/qa_2024/test_12308/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_12308/tmp_333be4bf.fbk')
tmp_res = PosixPath('/var/tmp/qa_2024/test_12308/tmp_333be4bf.fdb')
tmp_log = PosixPath('/var/tmp/qa_2024/test_12308/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
|