mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Fix multipart transfer timeout and enable its tests
This commit is contained in:
committed by
Dennis Klein
parent
5d37ab2f01
commit
b814e40c87
@@ -21,33 +21,88 @@ class TransferTimeout : public FairMQDevice
|
||||
protected:
|
||||
auto Run() -> void override
|
||||
{
|
||||
auto sendCanceling = false;
|
||||
auto receiveCanceling = false;
|
||||
bool sendMsgCanceling = false;
|
||||
bool receiveMsgCanceling = false;
|
||||
|
||||
auto msg1 = FairMQMessagePtr{NewMessage()};
|
||||
auto msg2 = FairMQMessagePtr{NewMessage()};
|
||||
FairMQMessagePtr msg1(NewMessage());
|
||||
FairMQMessagePtr msg2(NewMessage());
|
||||
|
||||
if (Send(msg1, "data-out", 0, 100) == -2)
|
||||
{
|
||||
LOG(info) << "send canceled";
|
||||
sendCanceling = true;
|
||||
LOG(info) << "send msg canceled";
|
||||
sendMsgCanceling = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(error) << "send did not cancel";
|
||||
LOG(error) << "send msg did not cancel";
|
||||
}
|
||||
|
||||
if (Receive(msg2, "data-in", 0, 100) == -2)
|
||||
{
|
||||
LOG(info) << "receive canceled";
|
||||
receiveCanceling = true;
|
||||
LOG(info) << "receive msg canceled";
|
||||
receiveMsgCanceling = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(error) << "receive did not cancel";
|
||||
LOG(error) << "receive msg did not cancel";
|
||||
}
|
||||
|
||||
if (sendCanceling && receiveCanceling)
|
||||
bool send1PartCanceling = false;
|
||||
bool receive1PartCanceling = false;
|
||||
|
||||
FairMQParts parts1;
|
||||
parts1.AddPart(NewMessage(10));
|
||||
FairMQParts parts2;
|
||||
|
||||
if (Send(parts1, "data-out", 0, 100) == -2)
|
||||
{
|
||||
LOG(info) << "send 1 part canceled";
|
||||
send1PartCanceling = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(error) << "send 1 part did not cancel";
|
||||
}
|
||||
|
||||
if (Receive(parts2, "data-in", 0, 100) == -2)
|
||||
{
|
||||
LOG(info) << "receive 1 part canceled";
|
||||
receive1PartCanceling = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(error) << "receive 1 part did not cancel";
|
||||
}
|
||||
|
||||
bool send2PartsCanceling = false;
|
||||
bool receive2PartsCanceling = false;
|
||||
|
||||
FairMQParts parts3;
|
||||
parts3.AddPart(NewMessage(10));
|
||||
parts3.AddPart(NewMessage(10));
|
||||
FairMQParts parts4;
|
||||
|
||||
if (Send(parts3, "data-out", 0, 100) == -2)
|
||||
{
|
||||
LOG(info) << "send 2 parts canceled";
|
||||
send2PartsCanceling = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(error) << "send 2 parts did not cancel";
|
||||
}
|
||||
|
||||
if (Receive(parts4, "data-in", 0, 100) == -2)
|
||||
{
|
||||
LOG(info) << "receive 2 parts canceled";
|
||||
receive2PartsCanceling = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(error) << "receive 2 parts did not cancel";
|
||||
}
|
||||
|
||||
if (sendMsgCanceling && receiveMsgCanceling && send1PartCanceling && receive1PartCanceling && send2PartsCanceling && receive2PartsCanceling)
|
||||
{
|
||||
LOG(info) << "Transfer timeout test successfull";
|
||||
}
|
||||
|
Reference in New Issue
Block a user