2 @message |
assert
- Total unique BLOB_ID values: 1
+ UNEXPECTED: number of unique BLOB_ID values is different from 1:
+ BLOB_ID_MON_STATEMENTS 0:5
+ BLOB_ID_MON_COMPILED_S 0:1
LOG DETAILS:
2025-04-18 15:27:47.048
2025-04-18 15:27:47.063 act = <firebird.qa.plugin.Action object at [hex]>
2025-04-18 15:27:47.077 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-04-18 15:27:47.086
2025-04-18 15:27:47.095 @pytest.mark.version('>=5.0.3')
2025-04-18 15:27:47.103 def test_1(act: Action, capsys):
2025-04-18 15:27:47.111 test_sql = f"""
2025-04-18 15:27:47.120 set list on;
2025-04-18 15:27:47.127 set blob all;
2025-04-18 15:27:47.134 select
2025-04-18 15:27:47.141 s.mon$sql_text as blob_id_mon_statements
2025-04-18 15:27:47.172 ,c.mon$sql_text as blob_id_mon_compiled_s
2025-04-18 15:27:47.183 from mon$statements s
2025-04-18 15:27:47.193 join mon$compiled_statements c using(mon$compiled_statement_id)
2025-04-18 15:27:47.202 where mon$attachment_id = current_connection and s.mon$sql_text is not null
2025-04-18 15:27:47.210 ;
2025-04-18 15:27:47.218 """
2025-04-18 15:27:47.228
2025-04-18 15:27:47.237 act.isql(switches = ['-q'], input = test_sql, combine_output = True)
2025-04-18 15:27:47.246
2025-04-18 15:27:47.261 blob_id_pattern = re.compile('^blob_id_mon_', re.IGNORECASE);
2025-04-18 15:27:47.273
2025-04-18 15:27:47.284 blob_ids_map = {}
2025-04-18 15:27:47.295 if act.return_code == 0:
2025-04-18 15:27:47.305 # Print only interesting lines from ISQl output tail:
2025-04-18 15:27:47.321 for line in act.clean_stdout.splitlines():
2025-04-18 15:27:47.334 if (blob_id_pattern.search(line)):
2025-04-18 15:27:47.345 blob_ids_map[ line.split()[0] ] = line.split()[1]
2025-04-18 15:27:47.354 if len(set(blob_ids_map.values())) == 1:
2025-04-18 15:27:47.363 print(f'{msg_prefix} {len(set(blob_ids_map.values()))}')
2025-04-18 15:27:47.371 else:
2025-04-18 15:27:47.379 print('UNEXPECTED: number of unique BLOB_ID values is different from 1:')
2025-04-18 15:27:47.388 for k,v in blob_ids_map.items():
2025-04-18 15:27:47.397 print(k,v)
2025-04-18 15:27:47.405 else:
2025-04-18 15:27:47.415 # If retcode !=0 then we can print the whole output of failed gbak:
2025-04-18 15:27:47.428 print('ISQL failed, check output:')
2025-04-18 15:27:47.439 for line in act.clean_stdout.splitlines():
2025-04-18 15:27:47.448 print(line)
2025-04-18 15:27:47.455 act.reset()
2025-04-18 15:27:47.462
2025-04-18 15:27:47.468 expected_stdout = f"""
2025-04-18 15:27:47.474 {msg_prefix} 1
2025-04-18 15:27:47.482 """
2025-04-18 15:27:47.495
2025-04-18 15:27:47.506 act.expected_stdout = expected_stdout
2025-04-18 15:27:47.514 act.stdout = capsys.readouterr().out
2025-04-18 15:27:47.521 > assert act.clean_stdout == act.clean_expected_stdout
2025-04-18 15:27:47.531 E assert
2025-04-18 15:27:47.545 E - Total unique BLOB_ID values: 1
2025-04-18 15:27:47.557 E + UNEXPECTED: number of unique BLOB_ID values is different from 1:
2025-04-18 15:27:47.572 E + BLOB_ID_MON_STATEMENTS 0:5
2025-04-18 15:27:47.585 E + BLOB_ID_MON_COMPILED_S 0:1
2025-04-18 15:27:47.595
2025-04-18 15:27:47.604 tests/bugs/gh_8513_test.py:75: AssertionError
2025-04-18 15:27:47.612 ---------------------------- Captured stdout setup -----------------------------
2025-04-18 15:27:47.628 Creating db: localhost:/var/tmp/qa_2024/test_11694/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]>
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=5.0.3')
def test_1(act: Action, capsys):
test_sql = f"""
set list on;
set blob all;
select
s.mon$sql_text as blob_id_mon_statements
,c.mon$sql_text as blob_id_mon_compiled_s
from mon$statements s
join mon$compiled_statements c using(mon$compiled_statement_id)
where mon$attachment_id = current_connection and s.mon$sql_text is not null
;
"""
act.isql(switches = ['-q'], input = test_sql, combine_output = True)
blob_id_pattern = re.compile('^blob_id_mon_', re.IGNORECASE);
blob_ids_map = {}
if act.return_code == 0:
# Print only interesting lines from ISQl output tail:
for line in act.clean_stdout.splitlines():
if (blob_id_pattern.search(line)):
blob_ids_map[ line.split()[0] ] = line.split()[1]
if len(set(blob_ids_map.values())) == 1:
print(f'{msg_prefix} {len(set(blob_ids_map.values()))}')
else:
print('UNEXPECTED: number of unique BLOB_ID values is different from 1:')
for k,v in blob_ids_map.items():
print(k,v)
else:
# If retcode !=0 then we can print the whole output of failed gbak:
print('ISQL failed, check output:')
for line in act.clean_stdout.splitlines():
print(line)
act.reset()
expected_stdout = f"""
{msg_prefix} 1
"""
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E - Total unique BLOB_ID values: 1
E + UNEXPECTED: number of unique BLOB_ID values is different from 1:
E + BLOB_ID_MON_STATEMENTS 0:5
E + BLOB_ID_MON_COMPILED_S 0:1
tests/bugs/gh_8513_test.py:75: AssertionError
|