Skip to content

Commit fdc10e3

Browse files
authored
Unmute ydb/tests/olap/scenario/test_insert.py.TestInsert.test[read_data_during_bulk_upsert] #13113 (#17467)
1 parent 83c1619 commit fdc10e3

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

.github/config/muted_ya.txt

-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ ydb/tests/olap/oom overlapping_portions.py.TestOverlappingPortions.test
118118
ydb/tests/olap/scenario sole chunk chunk
119119
ydb/tests/olap/scenario test_alter_compression.py.TestAlterCompression.test[alter_compression]
120120
ydb/tests/olap/scenario test_alter_tiering.py.TestAlterTiering.test[many_tables]
121-
ydb/tests/olap/scenario test_insert.py.TestInsert.test[read_data_during_bulk_upsert]
122121
ydb/tests/olap/scenario test_read_update_write_load.py.TestReadUpdateWriteLoad.test[read_update_write_load]
123122
ydb/tests/olap/ttl_tiering [data_migration_when_alter_ttl.py] chunk chunk
124123
ydb/tests/olap/ttl_tiering [ttl_delete_s3.py] chunk chunk

ydb/tests/olap/scenario/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_multi(self, ctx: TestContext):
9595
assert exit_codes == [0] * num_threads, exit_codes
9696

9797
def test(self, ctx: TestContext):
98-
self.def_inserts_count = 200
98+
self.def_inserts_count = 50
9999
exit_codes = [None]
100100
self._test_suffix(ctx, get_external_param("table_suffix", ""), exit_codes, 0)
101101

ydb/tests/olap/scenario/test_insert.py

+19-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
from ydb.tests.olap.common.thread_helper import TestThread, TestThreads
99
from ydb import PrimitiveType
1010
from typing import List, Dict, Any
11-
from ydb.tests.olap.lib.utils import get_external_param, external_param_is_true
11+
from ydb.tests.olap.lib.utils import get_external_param
12+
13+
import random
14+
import logging
15+
logger = logging.getLogger(__name__)
1216

1317

1418
class TestInsert(BaseTestSet):
@@ -26,16 +30,25 @@ class TestInsert(BaseTestSet):
2630
)
2731

2832
def _loop_upsert(self, ctx: TestContext, data: list, table: str):
33+
min_time = 10.0 / len(data)
34+
max_time = min_time * 10
35+
2936
sth = ScenarioTestHelper(ctx)
3037
table_name = "log" + table
3138
for batch in data:
3239
sth.bulk_upsert_data(table_name, self.schema_log, batch)
40+
logger.info("Upsert")
41+
time.sleep(random.uniform(min_time, max_time))
42+
43+
def _loop_insert(self, ctx: TestContext, rows_count: int, table: str):
44+
min_time = 1.0 / rows_count
45+
max_time = min_time * 10
3346

34-
def _loop_insert(self, ctx: TestContext, rows_count: int, table: str, ignore_read_errors: bool):
3547
sth = ScenarioTestHelper(ctx)
3648
log: str = sth.get_full_path("log" + table)
3749
cnt: str = sth.get_full_path("cnt" + table)
3850
for i in range(rows_count):
51+
logger.info("Insert")
3952
for c in range(10):
4053
try:
4154
result = sth.execute_query(
@@ -50,12 +63,9 @@ def _loop_insert(self, ctx: TestContext, rows_count: int, table: str, ignore_rea
5063

5164
break
5265
except Exception:
53-
if ignore_read_errors:
54-
pass
55-
else:
56-
if c >= 9:
57-
raise
58-
time.sleep(1)
66+
if c >= 9:
67+
raise
68+
time.sleep(random.uniform(min_time, max_time))
5969

6070
def scenario_read_data_during_bulk_upsert(self, ctx: TestContext):
6171
sth = ScenarioTestHelper(ctx)
@@ -65,7 +75,6 @@ def scenario_read_data_during_bulk_upsert(self, ctx: TestContext):
6575
rows_count = int(get_external_param("rows_count", "1000"))
6676
inserts_count = int(get_external_param("inserts_count", str(self.def_inserts_count)))
6777
tables_count = int(get_external_param("tables_count", "1"))
68-
ignore_read_errors = external_param_is_true("ignore_read_errors")
6978
for table in range(tables_count):
7079
sth.execute_scheme_query(
7180
CreateTable(cnt_table_name + str(table)).with_schema(self.schema_cnt)
@@ -86,7 +95,7 @@ def scenario_read_data_during_bulk_upsert(self, ctx: TestContext):
8695
for table in range(tables_count):
8796
thread1.append(TestThread(target=self._loop_upsert, args=[ctx, data, str(table)]))
8897
for table in range(tables_count):
89-
thread2.append(TestThread(target=self._loop_insert, args=[ctx, inserts_count, str(table), ignore_read_errors]))
98+
thread2.append(TestThread(target=self._loop_insert, args=[ctx, inserts_count, str(table)]))
9099

91100
thread1.start_all()
92101
thread2.start_all()

0 commit comments

Comments
 (0)