2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
"""
|
|
|
|
ID: issue-6288
|
|
|
|
ISSUE: 6288
|
|
|
|
TITLE: Srp user manager sporadically creates users which can not attach
|
2024-05-13 20:37:33 +02:00
|
|
|
DESCRIPTION:
|
2022-01-26 21:10:46 +01:00
|
|
|
Explanation of bug nature was provided by Alex, see letter 05-jun-19 13:51.
|
|
|
|
Some iteration failed with probability equal to occurence of 0 (zero) in the
|
|
|
|
highest BYTE of some number. Byte is 8 bit ==> this probability is 1/256.
|
|
|
|
Given 'N_LIMIT' is number of iterations, probability of success for ALL of
|
|
|
|
them is 7.5%, and when N_LIMIT is 1000 then p = 0.004%.
|
|
|
|
Because of time (speed) it was decided to run only 256 iterations. If bug
|
|
|
|
will be 'raised' somewhere then this number is enough to catch it after 2-3
|
|
|
|
times of test run.
|
2024-05-13 20:37:33 +02:00
|
|
|
NOTES:
|
2022-01-26 21:10:46 +01:00
|
|
|
Reproduced on WI-V3.0.5.33118, date: 11-apr-19 (got fails not late than on 250th iteration).
|
|
|
|
Works fine on WI-V3.0.5.33139, date: 04-apr-19.
|
|
|
|
A new bug was found during this test implementation, affected 4.0 Classic only: CORE-6080.
|
|
|
|
JIRA: CORE-6038
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_6038
|
2022-01-26 21:10:46 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
db_ = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-26 21:10:46 +01:00
|
|
|
act = python_act('db_')
|
2021-12-15 22:02:07 +01:00
|
|
|
|
|
|
|
CHECK_USR = 'tmp$c6038_srp'
|
|
|
|
CHECK_PWD = 'QweRty#6038$='
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0.5')
|
2022-01-26 21:10:46 +01:00
|
|
|
def test_1(act: Action):
|
2021-12-15 22:02:07 +01:00
|
|
|
N_LIMIT = 256
|
|
|
|
for i in range(N_LIMIT):
|
2022-01-26 21:10:46 +01:00
|
|
|
with User(act.db, name=CHECK_USR, password=CHECK_PWD, plugin='Srp', charset='utf8'):
|
|
|
|
with act.db.connect(user=CHECK_USR, password=CHECK_PWD):
|
2021-12-15 22:02:07 +01:00
|
|
|
pass
|
|
|
|
# Passed.
|
2021-04-26 20:07:00 +02:00
|
|
|
|