mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
Added/Updated tests\bugs\gh_6609_test.py: Separated definition of max ratio thresholds according to FB fork ('standard', 'HQbird', 'RedDatabase').
This commit is contained in:
parent
9c2a5e3755
commit
92fcac0ceb
@ -19,6 +19,10 @@ NOTES:
|
|||||||
4.0.5.3099, mon$memo_used ratio for CS: 1.01; SS: 1.00
|
4.0.5.3099, mon$memo_used ratio for CS: 1.01; SS: 1.00
|
||||||
5.0.1.1399, mon$memo_used ratio for CS: 1.11; SS: 1.02
|
5.0.1.1399, mon$memo_used ratio for CS: 1.11; SS: 1.02
|
||||||
6.0.0.351, mon$memo_used ratio for CS: 1.11; SS: 1.02
|
6.0.0.351, mon$memo_used ratio for CS: 1.11; SS: 1.02
|
||||||
|
|
||||||
|
[24.12.2024] pzotov
|
||||||
|
Separated definition of max ratio thresholds according to FB fork ('standard', 'HQbird', 'RedDatabase').
|
||||||
|
Requested by Anton Zuev, RedBase.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -41,24 +45,49 @@ act = python_act('db')
|
|||||||
@pytest.mark.version('>=3.0.0')
|
@pytest.mark.version('>=3.0.0')
|
||||||
def test_1(act: Action, capsys):
|
def test_1(act: Action, capsys):
|
||||||
|
|
||||||
#if act.platform == 'Windows':
|
|
||||||
# pytest.skip('Could not reproduce bug on Windows')
|
|
||||||
|
|
||||||
if act.get_server_architecture() == 'SuperServer':
|
|
||||||
MON_QUERY = 'select mon$memory_used from mon$memory_usage where mon$stat_group = 0'
|
|
||||||
MAX_THRESHOLD = 1.10
|
|
||||||
else:
|
|
||||||
MON_QUERY = """
|
|
||||||
select m.mon$memory_used
|
|
||||||
from mon$attachments a
|
|
||||||
join mon$memory_usage m on a.mon$stat_id = m.mon$stat_id
|
|
||||||
where a.mon$attachment_id = current_connection and m.mon$stat_group = 1;
|
|
||||||
"""
|
|
||||||
MAX_THRESHOLD = 1.20
|
|
||||||
|
|
||||||
mon_memo_beg = 1
|
mon_memo_beg = 1
|
||||||
mon_memo_end = 9999999
|
mon_memo_end = 9999999
|
||||||
with act.db.connect() as con:
|
with act.db.connect() as con:
|
||||||
|
|
||||||
|
# con.info.server_version output examples:
|
||||||
|
# Standard: 'WI-V6.3.2.1580 Firebird 5.0 7961de2'
|
||||||
|
# HQbird: 'WI-V6.3.2.1575 Firebird 5.0 HQbird'
|
||||||
|
# RedDatabase: 'LI-V6.3.2.0 RedDatabase 5.0 SNAPSHOT.15 (<sha>)'
|
||||||
|
#
|
||||||
|
fb_vers_txt = con.info.server_version
|
||||||
|
if 'RedDatabase' in fb_vers_txt:
|
||||||
|
fb_vers_key = 'red'
|
||||||
|
elif 'HQbird' in fb_vers_txt:
|
||||||
|
fb_vers_key = 'hqb'
|
||||||
|
else:
|
||||||
|
fb_vers_key = 'std'
|
||||||
|
|
||||||
|
###############################
|
||||||
|
### T H R E S H O L D S ###
|
||||||
|
###############################
|
||||||
|
# Requested by Anton Zuev, RedBase:
|
||||||
|
max_memo_ratios_map = {
|
||||||
|
('std', 'SuperServer') : 1.1
|
||||||
|
,('hqb', 'SuperServer') : 1.1
|
||||||
|
,('red', 'SuperServer') : 1.1
|
||||||
|
,('std', 'Classic') : 1.20
|
||||||
|
,('hqb', 'Classic') : 1.20
|
||||||
|
,('red', 'Classic') : 1.30
|
||||||
|
}
|
||||||
|
|
||||||
|
fb_mode = act.get_server_architecture()
|
||||||
|
MAX_THRESHOLD = max_memo_ratios_map[ fb_vers_key, fb_mode]
|
||||||
|
|
||||||
|
if fb_mode == 'SuperServer':
|
||||||
|
MON_QUERY = 'select mon$memory_used from mon$memory_usage where mon$stat_group = 0'
|
||||||
|
else:
|
||||||
|
MON_QUERY = """
|
||||||
|
select m.mon$memory_used
|
||||||
|
from mon$attachments a
|
||||||
|
join mon$memory_usage m on a.mon$stat_id = m.mon$stat_id
|
||||||
|
where a.mon$attachment_id = current_connection and m.mon$stat_group = 1;
|
||||||
|
"""
|
||||||
|
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
cur.execute(MON_QUERY)
|
cur.execute(MON_QUERY)
|
||||||
mon_memo_beg = int(cur.fetchone()[0])
|
mon_memo_beg = int(cur.fetchone()[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user