mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Extend transfer timeout test
This commit is contained in:
parent
0cfa9192d7
commit
919193a1ad
|
@ -24,88 +24,132 @@ class TransferTimeout : public FairMQDevice
|
||||||
protected:
|
protected:
|
||||||
auto Run() -> void override
|
auto Run() -> void override
|
||||||
{
|
{
|
||||||
bool sendMsgCanceling = false;
|
bool sendMsgCancelingAfter100ms = false;
|
||||||
bool receiveMsgCanceling = false;
|
bool receiveMsgCancelingAfter100ms = false;
|
||||||
|
|
||||||
|
bool sendMsgCancelingAfter0ms = false;
|
||||||
|
bool receiveMsgCancelingAfter0ms = false;
|
||||||
|
|
||||||
|
bool send1PartCancelingAfter100ms = false;
|
||||||
|
bool receive1PartCancelingAfter100ms = false;
|
||||||
|
|
||||||
|
bool send1PartCancelingAfter0ms = false;
|
||||||
|
bool receive1PartCancelingAfter0ms = false;
|
||||||
|
|
||||||
|
bool send2PartsCancelingAfter100ms = false;
|
||||||
|
bool receive2PartsCancelingAfter100ms = false;
|
||||||
|
|
||||||
|
bool send2PartsCancelingAfter0ms = false;
|
||||||
|
bool receive2PartsCancelingAfter0ms = false;
|
||||||
|
|
||||||
FairMQMessagePtr msg1(NewMessage());
|
FairMQMessagePtr msg1(NewMessage());
|
||||||
FairMQMessagePtr msg2(NewMessage());
|
FairMQMessagePtr msg2(NewMessage());
|
||||||
|
|
||||||
if (Send(msg1, "data-out", 0, 100) == -2)
|
if (Send(msg1, "data-out", 0, 100) == -2) {
|
||||||
{
|
LOG(info) << "send msg canceled (100ms)";
|
||||||
LOG(info) << "send msg canceled";
|
sendMsgCancelingAfter100ms = true;
|
||||||
sendMsgCanceling = true;
|
} else {
|
||||||
}
|
LOG(error) << "send msg did not cancel (100ms)";
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG(error) << "send msg did not cancel";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Receive(msg2, "data-in", 0, 100) == -2)
|
if (Receive(msg2, "data-in", 0, 100) == -2) {
|
||||||
{
|
LOG(info) << "receive msg canceled (100ms)";
|
||||||
LOG(info) << "receive msg canceled";
|
receiveMsgCancelingAfter100ms = true;
|
||||||
receiveMsgCanceling = true;
|
} else {
|
||||||
}
|
LOG(error) << "receive msg did not cancel (100ms)";
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG(error) << "receive msg did not cancel";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool send1PartCanceling = false;
|
if (Send(msg1, "data-out", 0, 0) == -2) {
|
||||||
bool receive1PartCanceling = false;
|
LOG(info) << "send msg canceled (0ms)";
|
||||||
|
sendMsgCancelingAfter0ms = true;
|
||||||
|
} else {
|
||||||
|
LOG(error) << "send msg did not cancel (0ms)";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Receive(msg2, "data-in", 0, 0) == -2) {
|
||||||
|
LOG(info) << "receive msg canceled (0ms)";
|
||||||
|
receiveMsgCancelingAfter0ms = true;
|
||||||
|
} else {
|
||||||
|
LOG(error) << "receive msg did not cancel (0ms)";
|
||||||
|
}
|
||||||
|
|
||||||
FairMQParts parts1;
|
FairMQParts parts1;
|
||||||
parts1.AddPart(NewMessage(10));
|
parts1.AddPart(NewMessage(10));
|
||||||
FairMQParts parts2;
|
FairMQParts parts2;
|
||||||
|
|
||||||
if (Send(parts1, "data-out", 0, 100) == -2)
|
if (Send(parts1, "data-out", 0, 100) == -2) {
|
||||||
{
|
LOG(info) << "send 1 part canceled (100ms)";
|
||||||
LOG(info) << "send 1 part canceled";
|
send1PartCancelingAfter100ms = true;
|
||||||
send1PartCanceling = true;
|
} else {
|
||||||
}
|
LOG(error) << "send 1 part did not cancel (100ms)";
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG(error) << "send 1 part did not cancel";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Receive(parts2, "data-in", 0, 100) == -2)
|
if (Receive(parts2, "data-in", 0, 100) == -2) {
|
||||||
{
|
LOG(info) << "receive 1 part canceled (100ms)";
|
||||||
LOG(info) << "receive 1 part canceled";
|
receive1PartCancelingAfter100ms = true;
|
||||||
receive1PartCanceling = true;
|
} else {
|
||||||
}
|
LOG(error) << "receive 1 part did not cancel (100ms)";
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG(error) << "receive 1 part did not cancel";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool send2PartsCanceling = false;
|
if (Send(parts1, "data-out", 0, 0) == -2) {
|
||||||
bool receive2PartsCanceling = false;
|
LOG(info) << "send 1 part canceled (0ms)";
|
||||||
|
send1PartCancelingAfter0ms = true;
|
||||||
|
} else {
|
||||||
|
LOG(error) << "send 1 part did not cancel (0ms)";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Receive(parts2, "data-in", 0, 0) == -2) {
|
||||||
|
LOG(info) << "receive 1 part canceled (0ms)";
|
||||||
|
receive1PartCancelingAfter0ms = true;
|
||||||
|
} else {
|
||||||
|
LOG(error) << "receive 1 part did not cancel (0ms)";
|
||||||
|
}
|
||||||
|
|
||||||
FairMQParts parts3;
|
FairMQParts parts3;
|
||||||
parts3.AddPart(NewMessage(10));
|
parts3.AddPart(NewMessage(10));
|
||||||
parts3.AddPart(NewMessage(10));
|
parts3.AddPart(NewMessage(10));
|
||||||
FairMQParts parts4;
|
FairMQParts parts4;
|
||||||
|
|
||||||
if (Send(parts3, "data-out", 0, 100) == -2)
|
if (Send(parts3, "data-out", 0, 100) == -2) {
|
||||||
{
|
LOG(info) << "send 2 parts canceled (100ms)";
|
||||||
LOG(info) << "send 2 parts canceled";
|
send2PartsCancelingAfter100ms = true;
|
||||||
send2PartsCanceling = true;
|
} else {
|
||||||
}
|
LOG(error) << "send 2 parts did not cancel (100ms)";
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG(error) << "send 2 parts did not cancel";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Receive(parts4, "data-in", 0, 100) == -2)
|
if (Receive(parts4, "data-in", 0, 100) == -2) {
|
||||||
{
|
LOG(info) << "receive 2 parts canceled (100ms)";
|
||||||
LOG(info) << "receive 2 parts canceled";
|
receive2PartsCancelingAfter100ms = true;
|
||||||
receive2PartsCanceling = true;
|
} else {
|
||||||
}
|
LOG(error) << "receive 2 parts did not cancel (100ms)";
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG(error) << "receive 2 parts did not cancel";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sendMsgCanceling && receiveMsgCanceling && send1PartCanceling && receive1PartCanceling && send2PartsCanceling && receive2PartsCanceling)
|
if (Send(parts3, "data-out", 0, 0) == -2) {
|
||||||
|
LOG(info) << "send 2 parts canceled (0ms)";
|
||||||
|
send2PartsCancelingAfter0ms = true;
|
||||||
|
} else {
|
||||||
|
LOG(error) << "send 2 parts did not cancel (0ms)";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Receive(parts4, "data-in", 0, 0) == -2) {
|
||||||
|
LOG(info) << "receive 2 parts canceled (0ms)";
|
||||||
|
receive2PartsCancelingAfter0ms = true;
|
||||||
|
} else {
|
||||||
|
LOG(error) << "receive 2 parts did not cancel (0ms)";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sendMsgCancelingAfter100ms &&
|
||||||
|
receiveMsgCancelingAfter100ms &&
|
||||||
|
sendMsgCancelingAfter0ms &&
|
||||||
|
receiveMsgCancelingAfter0ms &&
|
||||||
|
send1PartCancelingAfter100ms &&
|
||||||
|
receive1PartCancelingAfter100ms &&
|
||||||
|
send1PartCancelingAfter0ms &&
|
||||||
|
receive1PartCancelingAfter0ms &&
|
||||||
|
send2PartsCancelingAfter100ms &&
|
||||||
|
receive2PartsCancelingAfter100ms &&
|
||||||
|
send2PartsCancelingAfter0ms &&
|
||||||
|
receive2PartsCancelingAfter0ms)
|
||||||
{
|
{
|
||||||
LOG(info) << "Transfer timeout test successfull";
|
LOG(info) << "Transfer timeout test successfull";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user