@@ -317,6 +317,47 @@ TEST_F(XdcRdmaTest, SendRdma) {
317317 UNIT_ASSERT (recieverPtr->WhaitForRecieve (1 , 20 ));
318318}
319319
320+ TEST_F (XdcRdmaTest, SendRdmaWithShuffledPayload) {
321+ TTestICCluster cluster (2 );
322+ auto memPool = NInterconnect::NRdma::CreateDummyMemPool ();
323+ auto ev = new TEvTestSerialization ();
324+ ev->Record .SetBlobID (123 );
325+ ev->Record .SetBuffer (" hello world" );
326+ for (ui32 i = 0 ; i < 10 ; ++i) {
327+ if (i % 2 == 0 ) {
328+ TRope tmp (TString (5000 , ' X' ));
329+ ev->AddPayload (std::move (tmp));
330+ } else {
331+ auto buf = memPool->AllocRcBuf (5000 , 0 ).value ();
332+ std::fill (buf.GetDataMut (), buf.GetDataMut () + 5000 , ' Y' );
333+ ev->AddPayload (TRope (std::move (buf)));
334+ }
335+ }
336+
337+ auto recieverPtr = new TReceiveActor ([](TEvTestSerialization::TPtr ev) {
338+ Cerr << " Blob ID: " << ev->Get ()->Record .GetBlobID () << Endl;
339+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Record .GetBlobID (), 123u );
340+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Record .GetBuffer (), " hello world" );
341+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->GetPayload ().size (), 10u );
342+ for (ui32 i = 0 ; i < 10 ; ++i) {
343+ if (i % 2 == 0 ) {
344+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->GetPayload ()[i].GetSize (), 5000u );
345+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->GetPayload ()[i].ConvertToString (), TString (5000 , ' X' ));
346+ } else {
347+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->GetPayload ()[i].GetSize (), 5000u );
348+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->GetPayload ()[i].ConvertToString (), TString (5000 , ' Y' ));
349+ }
350+ }
351+ });
352+ const TActorId receiver = cluster.RegisterActor (recieverPtr, 1 );
353+
354+ Sleep (TDuration::MilliSeconds (1000 ));
355+
356+ auto senderPtr = new TSendActor (receiver, ev);
357+ cluster.RegisterActor (senderPtr, 2 );
358+ UNIT_ASSERT (recieverPtr->WhaitForRecieve (1 , 20 ));
359+ }
360+
320361TEST_F (XdcRdmaTest, SendRdmaWithRegionOffset) {
321362 TTestICCluster cluster (2 );
322363 auto memPool = NInterconnect::NRdma::CreateDummyMemPool ();
0 commit comments