15
15
namespace NKikimr ::NKqp {
16
16
17
17
Y_UNIT_TEST_SUITE (KqpOlapBlobsSharing) {
18
-
19
18
namespace {
20
19
class TTransferStatus {
21
20
private:
@@ -60,18 +59,23 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
60
59
return TConclusionStatus::Success ();
61
60
}
62
61
virtual void DoSerializeToProto (NKikimrColumnShardDataSharingProto::TInitiator::TController& /* proto*/ ) const override {
63
-
64
62
}
65
63
66
64
virtual TString GetClassName () const override {
67
65
return " test" ;
68
66
}
69
67
};
70
68
69
+ TKikimrSettings GetKikimrSettings () {
70
+ NKikimrConfig::TFeatureFlags featureFlags;
71
+ featureFlags.SetEnableAlterShardingInColumnShard (true );
72
+ return TKikimrSettings ().SetWithSampleTables (false ).SetFeatureFlags (featureFlags);
73
+ }
74
+
71
75
class TSharingDataTestCase {
72
76
private:
73
77
const ui32 ShardsCount;
74
- TKikimrRunner& Kikimr;
78
+ TKikimrRunner Kikimr;
75
79
TTypedLocalHelper Helper;
76
80
NYDBTest::TControllers::TGuard<NYDBTest::NColumnShard::TController> Controller;
77
81
std::vector<ui64> ShardIds;
@@ -86,9 +90,9 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
86
90
Helper.FillPKOnly (kff, recordsCount);
87
91
}
88
92
89
- TSharingDataTestCase (const ui32 shardsCount, TKikimrRunner& kikimr )
93
+ TSharingDataTestCase (const ui32 shardsCount)
90
94
: ShardsCount(shardsCount)
91
- , Kikimr(kikimr )
95
+ , Kikimr(GetKikimrSettings() )
92
96
, Helper(" " , Kikimr, " olapTable" , " olapStore12" )
93
97
, Controller(NYDBTest::TControllers::RegisterCSControllerGuard<NYDBTest::NColumnShard::TController>()) {
94
98
Controller->SetCompactionControl (NYDBTest::EOptimizerCompactionWeightControl::Disable);
@@ -196,18 +200,14 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
196
200
}
197
201
};
198
202
Y_UNIT_TEST (BlobsSharingSplit1_1) {
199
- auto settings = TKikimrSettings ().SetWithSampleTables (false );
200
- TKikimrRunner kikimr (settings);
201
- TSharingDataTestCase tester (4 , kikimr);
203
+ TSharingDataTestCase tester (4 );
202
204
tester.AddRecords (800000 );
203
205
Sleep (TDuration::Seconds (1 ));
204
206
tester.Execute (0 , { 1 }, false , NOlap::TSnapshot (TInstant::Now ().MilliSeconds (), 1232123 ), { 0 });
205
207
}
206
208
207
209
Y_UNIT_TEST (BlobsSharingSplit1_1_clean) {
208
- auto settings = TKikimrSettings ().SetWithSampleTables (false );
209
- TKikimrRunner kikimr (settings);
210
- TSharingDataTestCase tester (2 , kikimr);
210
+ TSharingDataTestCase tester (2 );
211
211
tester.AddRecords (80000 );
212
212
CompareYson (tester.GetHelper ().GetQueryResult (" SELECT COUNT(*) FROM `/Root/olapStore12/olapTable`" ), R"( [[80000u;]])" );
213
213
Sleep (TDuration::Seconds (1 ));
@@ -219,9 +219,7 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
219
219
}
220
220
221
221
Y_UNIT_TEST (BlobsSharingSplit1_1_clean_with_restarts) {
222
- auto settings = TKikimrSettings ().SetWithSampleTables (false );
223
- TKikimrRunner kikimr (settings);
224
- TSharingDataTestCase tester (2 , kikimr);
222
+ TSharingDataTestCase tester (2 );
225
223
tester.SetRebootTablet (true );
226
224
tester.AddRecords (80000 );
227
225
CompareYson (tester.GetHelper ().GetQueryResult (" SELECT COUNT(*) FROM `/Root/olapStore12/olapTable`" ), R"( [[80000u;]])" );
@@ -234,18 +232,14 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
234
232
}
235
233
236
234
Y_UNIT_TEST (BlobsSharingSplit3_1) {
237
- auto settings = TKikimrSettings ().SetWithSampleTables (false );
238
- TKikimrRunner kikimr (settings);
239
- TSharingDataTestCase tester (4 , kikimr);
235
+ TSharingDataTestCase tester (4 );
240
236
tester.AddRecords (800000 );
241
237
Sleep (TDuration::Seconds (1 ));
242
238
tester.Execute (0 , { 1 , 2 , 3 }, false , NOlap::TSnapshot (TInstant::Now ().MilliSeconds (), 1232123 ), { 0 });
243
239
}
244
240
245
241
Y_UNIT_TEST (BlobsSharingSplit1_3_1) {
246
- auto settings = TKikimrSettings ().SetWithSampleTables (false );
247
- TKikimrRunner kikimr (settings);
248
- TSharingDataTestCase tester (4 , kikimr);
242
+ TSharingDataTestCase tester (4 );
249
243
tester.AddRecords (800000 );
250
244
Sleep (TDuration::Seconds (1 ));
251
245
tester.Execute (1 , { 0 }, false , NOlap::TSnapshot (TInstant::Now ().MilliSeconds (), 1232123 ), { 0 });
@@ -255,9 +249,7 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
255
249
}
256
250
257
251
Y_UNIT_TEST (BlobsSharingSplit1_3_2_1_clean) {
258
- auto settings = TKikimrSettings ().SetWithSampleTables (false );
259
- TKikimrRunner kikimr (settings);
260
- TSharingDataTestCase tester (4 , kikimr);
252
+ TSharingDataTestCase tester (4 );
261
253
tester.AddRecords (800000 );
262
254
Sleep (TDuration::Seconds (1 ));
263
255
tester.Execute (1 , { 0 }, false , NOlap::TSnapshot (TInstant::Now ().MilliSeconds (), 1232123 ), { 0 });
@@ -273,7 +265,7 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
273
265
class TReshardingTest {
274
266
public:
275
267
TReshardingTest ()
276
- : Kikimr(TKikimrSettings().SetWithSampleTables( false ))
268
+ : Kikimr(GetKikimrSettings( ))
277
269
, CSController(NYDBTest::TControllers::RegisterCSControllerGuard<NYDBTest::NColumnShard::TController>())
278
270
, TableClient(Kikimr.GetTableClient()) {
279
271
CSController->SetOverridePeriodicWakeupActivationPeriod (TDuration::Seconds (1 ));
0 commit comments