Skip to content

Commit dfa8bde

Browse files
committed
WIP
1 parent 32a71a7 commit dfa8bde

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

ydb/core/tx/datashard/datashard_ut_incremental_restore_scan.cpp

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66

77
namespace NKikimr::NDataShard {
88

9+
class TDriverMock
10+
: public NTable::IDriver
11+
{
12+
public:
13+
void Touch(NTable::EScan) noexcept {
14+
15+
}
16+
};
17+
18+
class TCbExecutorActor : public TActorBootstrapped<TCbExecutorActor> {
19+
public:
20+
std::function<void()> Cb;
21+
22+
void Bootstrap() {
23+
Cb();
24+
}
25+
};
26+
927
Y_UNIT_TEST_SUITE(IncrementalRestoreScan) {
1028
Y_UNIT_TEST(Simple) {
1129
TPortManager pm;
@@ -21,7 +39,15 @@ Y_UNIT_TEST_SUITE(IncrementalRestoreScan) {
2139
runtime.SetLogPriority(NKikimrServices::TX_DATASHARD, NLog::PRI_TRACE);
2240
runtime.SetLogPriority(NKikimrServices::TX_PROXY, NLog::PRI_TRACE);
2341

24-
TUserTable::TCPtr table;
42+
TUserTable::TPtr table = new TUserTable;
43+
44+
table->Columns.emplace(0, TUserTable::TUserColumn{});
45+
46+
NTable::TScheme::TTableSchema tableSchema;
47+
tableSchema.Columns[0] = NTable::TColumn("test", 0, {}, "");
48+
tableSchema.Columns[0].KeyOrder = 0;
49+
auto scheme = NTable::TRowScheme::Make(tableSchema.Columns, NUtil::TSecond());
50+
2551
TPathId targetPathId{};
2652
ui64 txId = 0;
2753

@@ -34,6 +60,17 @@ Y_UNIT_TEST_SUITE(IncrementalRestoreScan) {
3460
table,
3561
targetPathId,
3662
txId);
63+
64+
TDriverMock driver;
65+
auto* executor = new TCbExecutorActor;
66+
executor->Cb = [&]() {
67+
scan->Prepare(&driver, scheme);
68+
};
69+
auto executorActor = runtime.Register(executor);
70+
runtime.EnableScheduleForActor(executorActor);
71+
72+
auto resp = runtime.GrabEdgeEventRethrow<TEvIncrementalRestoreScan::TEvFinished>(sender);
73+
Y_UNUSED(resp);
3774
}
3875
}
3976

ydb/core/tx/datashard/incr_restore_scan.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class TIncrementalRestoreScan
5757
{}
5858

5959
static TVector<TTag> InitValueTags(TUserTable::TCPtr table) {
60+
Y_VERIFY(table->Columns.size() >= 1);
6061
TVector<TTag> valueTags;
6162
valueTags.reserve(table->Columns.size() - 1);
6263
for (const auto& [tag, column] : table->Columns) {

0 commit comments

Comments
 (0)