Skip to content

Commit 298b189

Browse files
authored
Fix flaky KqpOlapScheme.DropTable (#6795)
1 parent eba228e commit 298b189

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

.github/config/muted_ya.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ ydb/core/kqp/ut/scheme KqpOlapScheme.TenThousandColumns
1919
ydb/core/kqp/ut/scheme KqpOlap.OlapRead_GenericQuerys
2020
ydb/core/kqp/ut/scheme KqpOlap.OlapRead_StreamGenericQuery
2121
ydb/core/kqp/ut/scheme KqpOlap.OlapRead_UsesGenericQueryOnJoinWithDataShardTable
22-
ydb/core/kqp/ut/scheme KqpOlapScheme.DropTable
2322
ydb/core/kqp/ut/scheme KqpScheme.AlterAsyncReplication
2423
ydb/core/kqp/ut/scheme KqpScheme.QueryWithAlter
2524
ydb/core/kqp/ut/scheme [14/50]*

ydb/core/kqp/ut/common/columnshard.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ namespace NKqp {
130130
}
131131
}
132132

133+
void TTestHelper::WaitTabletDeletionInHive(ui64 tabletId, TDuration duration) {
134+
auto deadline = TInstant::Now() + duration;
135+
while (GetKikimr().GetTestClient().TabletExistsInHive(&GetRuntime(), tabletId) && TInstant::Now() <= deadline) {
136+
Cerr << "WaitTabletDeletionInHive: wait until " << tabletId << " is deleted" << Endl;
137+
Sleep(TDuration::Seconds(1));
138+
}
139+
}
140+
133141
TString TTestHelper::TColumnSchema::BuildQuery() const {
134142
TStringBuilder str;
135143
str << Name << ' ';

ydb/core/kqp/ut/common/columnshard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ namespace NKqp {
8282
void BulkUpsert(const TColumnTable& table, std::shared_ptr<arrow::RecordBatch> batch, const Ydb::StatusIds_StatusCode& opStatus = Ydb::StatusIds::SUCCESS);
8383
void ReadData(const TString& query, const TString& expected, const NYdb::EStatus opStatus = NYdb::EStatus::SUCCESS);
8484
void RebootTablets(const TString& tableName);
85+
void WaitTabletDeletionInHive(ui64 tabletId, TDuration duration);
8586
};
8687

8788
}

ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6467,6 +6467,7 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) {
64676467
}
64686468
testHelper.DropTable("/Root/ColumnTableTest");
64696469
for (auto tablet: tabletIds) {
6470+
testHelper.WaitTabletDeletionInHive(tablet, TDuration::Seconds(5));
64706471
UNIT_ASSERT_C(!testHelper.GetKikimr().GetTestClient().TabletExistsInHive(&testHelper.GetRuntime(), tablet), ToString(tablet) + " is alive");
64716472
}
64726473
}

0 commit comments

Comments
 (0)