Skip to content

Commit d67cd25

Browse files
authored
Fix flapping B-Tree tests (#4375)
1 parent 4072389 commit d67cd25

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

ydb/core/tablet_flat/ut/ut_btree_index_iter_charge.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,17 @@ Y_UNIT_TEST_SUITE(TChargeBTreeIndex) {
446446
}
447447

448448
void CheckChargeRowId(TTestParams params, const TPartStore& part, TTagsRef tags, const TKeyCellDefaults *keyDefaults) {
449+
#if !defined(_tsan_enabled_) && !defined(_msan_enabled_) && !defined(_asan_enabled_)
449450
for (bool reverse : {false, true}) {
450451
for (ui64 itemsLimit : TVector<ui64>{0, 1, 2, 5, 13, 19, part.Stat.Rows - 2, part.Stat.Rows - 1}) {
451452
for (TRowId rowId1 : xrange<TRowId>(0, part.Stat.Rows - 1)) {
452453
for (TRowId rowId2 : xrange<TRowId>(rowId1, part.Stat.Rows - 1)) {
454+
#else
455+
for (bool reverse : {false, true}) {
456+
for (ui64 itemsLimit : TVector<ui64>{0, 5, part.Stat.Rows - 1}) {
457+
for (TRowId rowId1 : xrange<TRowId>(0, part.Stat.Rows - 1, 3)) {
458+
for (TRowId rowId2 : xrange<TRowId>(rowId1, part.Stat.Rows - 1, 3)) {
459+
#endif
453460
TTouchEnv bTreeEnv, flatEnv;
454461
TChargeBTreeIndex bTree(&bTreeEnv, part, tags, true);
455462
TChargeFlatIndex flat(&flatEnv, part, tags, true);
@@ -467,12 +474,21 @@ Y_UNIT_TEST_SUITE(TChargeBTreeIndex) {
467474
}
468475

469476
void CheckChargeKeys(TTestParams params, const TPartStore& part, TTagsRef tags, const TKeyCellDefaults *keyDefaults) {
477+
#if !defined(_tsan_enabled_) && !defined(_msan_enabled_) && !defined(_asan_enabled_)
470478
for (bool reverse : {false, true}) {
471479
for (ui64 itemsLimit : TVector<ui64>{0, 1, 2, 5, 13, 19, part.Stat.Rows - 2, part.Stat.Rows - 1}) {
472480
for (ui32 firstCellKey1 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
473481
for (ui32 secondCellKey1 : xrange<ui32>(0, 14)) {
474482
for (ui32 firstCellKey2 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
475483
for (ui32 secondCellKey2 : xrange<ui32>(0, 14)) {
484+
#else
485+
for (bool reverse : {false, true}) {
486+
for (ui64 itemsLimit : TVector<ui64>{0, 5, part.Stat.Rows - 1}) {
487+
for (ui32 firstCellKey1 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
488+
for (ui32 secondCellKey1 : xrange<ui32>(10, 14)) {
489+
for (ui32 firstCellKey2 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
490+
for (ui32 secondCellKey2 : xrange<ui32>(10, 14)) {
491+
#endif
476492
TVector<TCell> key1 = MakeKey(firstCellKey1, secondCellKey1);
477493
TVector<TCell> key2 = MakeKey(firstCellKey2, secondCellKey2);
478494

@@ -511,10 +527,17 @@ Y_UNIT_TEST_SUITE(TChargeBTreeIndex) {
511527
}
512528

513529
void CheckChargeBytesLimit(TTestParams params, const TPartStore& part, TTagsRef tags, const TKeyCellDefaults *keyDefaults) {
530+
#if !defined(_tsan_enabled_) && !defined(_msan_enabled_) && !defined(_asan_enabled_)
514531
for (bool reverse : {false, true}) {
515532
for (ui64 bytesLimit : xrange<ui64>(1, part.Stat.Bytes + 100, part.Stat.Bytes / 100)) {
516533
for (ui32 firstCellKey1 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
517534
for (ui32 secondCellKey1 : xrange<ui32>(0, 14)) {
535+
#else
536+
for (bool reverse : {false, true}) {
537+
for (ui64 bytesLimit : TVector<ui64>{1l, part.Stat.Bytes / 3}) {
538+
for (ui32 firstCellKey1 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
539+
for (ui32 secondCellKey1 : xrange<ui32>(10, 14)) {
540+
#endif
518541
TVector<TCell> key1 = MakeKey(firstCellKey1, secondCellKey1);
519542

520543
TTouchEnv limitedEnv, unlimitedEnv;
@@ -752,9 +775,15 @@ Y_UNIT_TEST_SUITE(TPartBtreeIndexIteration) {
752775
tags.push_back(c.Tag);
753776
}
754777

778+
#if !defined(_tsan_enabled_) && !defined(_msan_enabled_) && !defined(_asan_enabled_)
755779
for (ESeek seek : {ESeek::Exact, ESeek::Lower, ESeek::Upper}) {
756780
for (ui32 firstCell : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
757781
for (ui32 secondCell : xrange<ui32>(0, 14)) {
782+
#else
783+
for (ESeek seek : {ESeek::Exact, ESeek::Lower, ESeek::Upper}) {
784+
for (ui32 firstCell : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
785+
for (ui32 secondCell : xrange<ui32>(10, 14)) {
786+
#endif
758787
TVector<TCell> key = MakeKey(firstCell, secondCell);
759788

760789
TTouchEnv bTreeEnv, flatEnv;
@@ -804,11 +833,19 @@ Y_UNIT_TEST_SUITE(TPartBtreeIndexIteration) {
804833
tags.push_back(c.Tag);
805834
}
806835

836+
#if !defined(_tsan_enabled_) && !defined(_msan_enabled_) && !defined(_asan_enabled_)
807837
for (ui64 itemsLimit : part.Slices->size() > 1 ? TVector<ui64>{0, 1, 2, 5} : TVector<ui64>{0, 1, 2, 5, 13, 19, part.Stat.Rows - 2, part.Stat.Rows - 1}) {
808838
for (ui32 firstCellKey1 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
809839
for (ui32 secondCellKey1 : xrange<ui32>(0, 14)) {
810840
for (ui32 firstCellKey2 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
811841
for (ui32 secondCellKey2 : xrange<ui32>(0, 14)) {
842+
#else
843+
for (ui64 itemsLimit : part.Slices->size() > 1 ? TVector<ui64>{0, 3} : TVector<ui64>{0, 5, part.Stat.Rows - 1}) {
844+
for (ui32 firstCellKey1 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
845+
for (ui32 secondCellKey1 : xrange<ui32>(10, 14)) {
846+
for (ui32 firstCellKey2 : xrange<ui32>(0, part.Stat.Rows / 7 + 1)) {
847+
for (ui32 secondCellKey2 : xrange<ui32>(10, 14)) {
848+
#endif
812849
TVector<TCell> key1 = MakeKey(firstCellKey1, secondCellKey1);
813850
TVector<TCell> key2 = MakeKey(firstCellKey2, secondCellKey2);
814851

ydb/core/util/btree_benchmark/ya.make

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Y_BENCHMARK()
22

3+
TAG(ya:fat)
4+
SIZE(LARGE)
5+
TIMEOUT(600)
6+
37
ALLOCATOR(LF)
48

59
PEERDIR(

0 commit comments

Comments
 (0)