@@ -196,8 +196,7 @@ Y_UNIT_TEST_SUITE(DataShardWrite) {
196
196
197
197
Cout << " ========= Wait for completed transaction =========\n " ;
198
198
{
199
- auto ev = runtime.GrabEdgeEventRethrow <NEvents::TDataEvents::TEvWriteResult>(sender);
200
- auto writeResult = ev->Get ()->Record ;
199
+ auto writeResult = WaitForWriteCompleted (runtime, sender);
201
200
202
201
UNIT_ASSERT_VALUES_EQUAL_C (writeResult.GetStatus (), NKikimrDataEvents::TEvWriteResult::STATUS_COMPLETED, " Status: " << writeResult.GetStatus () << " Issues: " << writeResult.GetIssues ());
203
202
UNIT_ASSERT_VALUES_EQUAL (writeResult.GetOrigin (), shard);
@@ -217,6 +216,43 @@ Y_UNIT_TEST_SUITE(DataShardWrite) {
217
216
UNIT_ASSERT_VALUES_EQUAL (tableState, expectedTableState);
218
217
}
219
218
219
+ }
220
+
221
+ Y_UNIT_TEST (WritePreparedNoTxCache) {
222
+ auto [runtime, server, sender] = TestCreateServer ();
223
+
224
+ TShardedTableOptions opts;
225
+ opts.DataTxCacheSize (0 ); // disabling the tx cache for forced serialization/deserialization of txs
226
+ const auto [shards, tableId] = CreateShardedTable (server, sender, " /Root" , " table-1" , opts);
227
+ const ui64 shard = shards[0 ];
228
+ const ui32 rowCount = 3 ;
229
+
230
+ ui64 txId = 100 ;
231
+ ui64 minStep, maxStep;
232
+
233
+ Cout << " ========= Send prepare =========\n " ;
234
+ {
235
+ const auto writeResult = Write (runtime, sender, shard, tableId, opts.Columns_ , rowCount, txId, NKikimrDataEvents::TEvWrite::MODE_PREPARE);
236
+ minStep = writeResult.GetMinStep ();
237
+ maxStep = writeResult.GetMaxStep ();
238
+ }
239
+
240
+ Cout << " ========= Send propose to coordinator =========\n " ;
241
+ {
242
+ SendProposeToCoordinator (server, shards, minStep, maxStep, txId);
243
+ }
244
+
245
+ Cout << " ========= Wait for completed transaction =========\n " ;
246
+ {
247
+ WaitForWriteCompleted (runtime, sender);
248
+ }
249
+
250
+ Cout << " ========= Read table =========\n " ;
251
+ {
252
+ auto tableState = TReadTableState (server, MakeReadTableSettings (" /Root/table-1" )).All ();
253
+ UNIT_ASSERT_VALUES_EQUAL (tableState, expectedTableState);
254
+ }
255
+
220
256
} // Y_UNIT_TEST
221
257
222
258
} // Y_UNIT_TEST_SUITE
0 commit comments