fix parallel running tests failure

This commit is contained in:
Alexey Rybalchenko 2016-07-11 10:58:30 +02:00
parent 64f1fd2a3b
commit 13a5cea1d7
7 changed files with 101 additions and 31 deletions

View File

@ -19,13 +19,23 @@ int main(int argc, char** argv)
{ {
FairMQTestPub testPub; FairMQTestPub testPub;
testPub.CatchSignals(); testPub.CatchSignals();
if (argc == 2)
std::string transport;
if (argc != 2)
{ {
testPub.SetTransport(argv[1]); LOG(ERROR) << "Transport for the test not specified!";
return 1;
}
transport = argv[1];
if (transport == "zeromq" || transport == "nanomsg")
{
testPub.SetTransport(transport);
} }
else else
{ {
testPub.SetTransport("zeromq"); LOG(ERROR) << "Incorrect transport requested! Expected 'zeromq' or 'nanomsg', found: " << transport;
return 1;
} }
reinit_logger(false); reinit_logger(false);
@ -33,7 +43,7 @@ int main(int argc, char** argv)
testPub.SetProperty(FairMQTestPub::Id, "testPub"); testPub.SetProperty(FairMQTestPub::Id, "testPub");
FairMQChannel controlChannel("pull", "bind", "tcp://127.0.0.1:5555"); FairMQChannel controlChannel("pull", "bind", "tcp://127.0.0.1:5555");
if (argc == 2) if (transport == "nanomsg")
{ {
controlChannel.UpdateAddress("tcp://127.0.0.1:5755"); controlChannel.UpdateAddress("tcp://127.0.0.1:5755");
} }
@ -41,7 +51,7 @@ int main(int argc, char** argv)
testPub.fChannels["control"].push_back(controlChannel); testPub.fChannels["control"].push_back(controlChannel);
FairMQChannel pubChannel("pub", "bind", "tcp://127.0.0.1:5556"); FairMQChannel pubChannel("pub", "bind", "tcp://127.0.0.1:5556");
if (argc == 2) if (transport == "nanomsg")
{ {
pubChannel.UpdateAddress("tcp://127.0.0.1:5756"); pubChannel.UpdateAddress("tcp://127.0.0.1:5756");
} }

View File

@ -21,13 +21,23 @@ int main(int argc, char** argv)
{ {
FairMQTestSub testSub; FairMQTestSub testSub;
testSub.CatchSignals(); testSub.CatchSignals();
if (argc == 2)
std::string transport;
if (argc != 2)
{ {
testSub.SetTransport(argv[1]); LOG(ERROR) << "Transport for the test not specified!";
return 1;
}
transport = argv[1];
if (transport == "zeromq" || transport == "nanomsg")
{
testSub.SetTransport(transport);
} }
else else
{ {
testSub.SetTransport("zeromq"); LOG(ERROR) << "Incorrect transport requested! Expected 'zeromq' or 'nanomsg', found: " << transport;
return 1;
} }
reinit_logger(false); reinit_logger(false);
@ -36,7 +46,7 @@ int main(int argc, char** argv)
testSub.SetProperty(FairMQTestSub::Id, "testSub_" + std::to_string(getpid())); testSub.SetProperty(FairMQTestSub::Id, "testSub_" + std::to_string(getpid()));
FairMQChannel controlChannel("push", "connect", "tcp://127.0.0.1:5555"); FairMQChannel controlChannel("push", "connect", "tcp://127.0.0.1:5555");
if (argc == 2) if (transport == "nanomsg")
{ {
controlChannel.UpdateAddress("tcp://127.0.0.1:5755"); controlChannel.UpdateAddress("tcp://127.0.0.1:5755");
} }
@ -44,7 +54,7 @@ int main(int argc, char** argv)
testSub.fChannels["control"].push_back(controlChannel); testSub.fChannels["control"].push_back(controlChannel);
FairMQChannel subChannel("sub", "connect", "tcp://127.0.0.1:5556"); FairMQChannel subChannel("sub", "connect", "tcp://127.0.0.1:5556");
if (argc == 2) if (transport == "nanomsg")
{ {
subChannel.UpdateAddress("tcp://127.0.0.1:5756"); subChannel.UpdateAddress("tcp://127.0.0.1:5756");
} }

View File

@ -19,13 +19,23 @@ int main(int argc, char** argv)
{ {
FairMQTestPull testPull; FairMQTestPull testPull;
testPull.CatchSignals(); testPull.CatchSignals();
if (argc == 2)
std::string transport;
if (argc != 2)
{ {
testPull.SetTransport(argv[1]); LOG(ERROR) << "Transport for the test not specified!";
return 1;
}
transport = argv[1];
if (transport == "zeromq" || transport == "nanomsg")
{
testPull.SetTransport(transport);
} }
else else
{ {
testPull.SetTransport("zeromq"); LOG(ERROR) << "Incorrect transport requested! Expected 'zeromq' or 'nanomsg', found: " << transport;
return 1;
} }
reinit_logger(false); reinit_logger(false);
@ -33,7 +43,7 @@ int main(int argc, char** argv)
testPull.SetProperty(FairMQTestPull::Id, "testPull"); testPull.SetProperty(FairMQTestPull::Id, "testPull");
FairMQChannel pullChannel("pull", "connect", "tcp://127.0.0.1:5557"); FairMQChannel pullChannel("pull", "connect", "tcp://127.0.0.1:5557");
if (argc == 2) if (transport == "nanomsg")
{ {
pullChannel.UpdateAddress("tcp://127.0.0.1:5757"); pullChannel.UpdateAddress("tcp://127.0.0.1:5757");
} }

View File

@ -19,13 +19,23 @@ int main(int argc, char** argv)
{ {
FairMQTestPush testPush; FairMQTestPush testPush;
testPush.CatchSignals(); testPush.CatchSignals();
if (argc == 2)
std::string transport;
if (argc != 2)
{ {
testPush.SetTransport(argv[1]); LOG(ERROR) << "Transport for the test not specified!";
return 1;
}
transport = argv[1];
if (transport == "zeromq" || transport == "nanomsg")
{
testPush.SetTransport(transport);
} }
else else
{ {
testPush.SetTransport("zeromq"); LOG(ERROR) << "Incorrect transport requested! Expected 'zeromq' or 'nanomsg', found: " << transport;
return 1;
} }
reinit_logger(false); reinit_logger(false);
@ -34,7 +44,7 @@ int main(int argc, char** argv)
testPush.SetProperty(FairMQTestPush::Id, "testPush"); testPush.SetProperty(FairMQTestPush::Id, "testPush");
FairMQChannel pushChannel("push", "bind", "tcp://127.0.0.1:5557"); FairMQChannel pushChannel("push", "bind", "tcp://127.0.0.1:5557");
if (argc == 2) if (transport == "nanomsg")
{ {
pushChannel.UpdateAddress("tcp://127.0.0.1:5757"); pushChannel.UpdateAddress("tcp://127.0.0.1:5757");
} }

View File

@ -21,13 +21,23 @@ int main(int argc, char** argv)
{ {
FairMQTestRep testRep; FairMQTestRep testRep;
testRep.CatchSignals(); testRep.CatchSignals();
if (argc == 2)
std::string transport;
if (argc != 2)
{ {
testRep.SetTransport(argv[1]); LOG(ERROR) << "Transport for the test not specified!";
return 1;
}
transport = argv[1];
if (transport == "zeromq" || transport == "nanomsg")
{
testRep.SetTransport(transport);
} }
else else
{ {
testRep.SetTransport("zeromq"); LOG(ERROR) << "Incorrect transport requested! Expected 'zeromq' or 'nanomsg', found: " << transport;
return 1;
} }
reinit_logger(false); reinit_logger(false);
@ -35,7 +45,7 @@ int main(int argc, char** argv)
testRep.SetProperty(FairMQTestRep::Id, "testRep"); testRep.SetProperty(FairMQTestRep::Id, "testRep");
FairMQChannel repChannel("rep", "bind", "tcp://127.0.0.1:5558"); FairMQChannel repChannel("rep", "bind", "tcp://127.0.0.1:5558");
if (argc == 2) if (transport == "nanomsg")
{ {
repChannel.UpdateAddress("tcp://127.0.0.1:5758"); repChannel.UpdateAddress("tcp://127.0.0.1:5758");
} }

View File

@ -21,13 +21,23 @@ int main(int argc, char** argv)
{ {
FairMQTestReq testReq; FairMQTestReq testReq;
testReq.CatchSignals(); testReq.CatchSignals();
if (argc == 2)
std::string transport;
if (argc != 2)
{ {
testReq.SetTransport(argv[1]); LOG(ERROR) << "Transport for the test not specified!";
return 1;
}
transport = argv[1];
if (transport == "zeromq" || transport == "nanomsg")
{
testReq.SetTransport(transport);
} }
else else
{ {
testReq.SetTransport("zeromq"); LOG(ERROR) << "Incorrect transport requested! Expected 'zeromq' or 'nanomsg', found: " << transport;
return 1;
} }
reinit_logger(false); reinit_logger(false);
@ -36,7 +46,7 @@ int main(int argc, char** argv)
testReq.SetProperty(FairMQTestReq::Id, "testReq" + std::to_string(getpid())); testReq.SetProperty(FairMQTestReq::Id, "testReq" + std::to_string(getpid()));
FairMQChannel reqChannel("req", "connect", "tcp://127.0.0.1:5558"); FairMQChannel reqChannel("req", "connect", "tcp://127.0.0.1:5558");
if (argc == 2) if (transport == "nanomsg")
{ {
reqChannel.UpdateAddress("tcp://127.0.0.1:5758"); reqChannel.UpdateAddress("tcp://127.0.0.1:5758");
} }

View File

@ -91,13 +91,23 @@ int main(int argc, char** argv)
{ {
TransferTimeoutTester timeoutTester; TransferTimeoutTester timeoutTester;
timeoutTester.CatchSignals(); timeoutTester.CatchSignals();
if (argc == 2)
std::string transport;
if (argc != 2)
{ {
timeoutTester.SetTransport(argv[1]); LOG(ERROR) << "Transport for the test not specified!";
return 1;
}
transport = argv[1];
if (transport == "zeromq" || transport == "nanomsg")
{
timeoutTester.SetTransport(transport);
} }
else else
{ {
timeoutTester.SetTransport("zeromq"); LOG(ERROR) << "Incorrect transport requested! Expected 'zeromq' or 'nanomsg', found: " << transport;
return 1;
} }
reinit_logger(false); reinit_logger(false);
@ -108,7 +118,7 @@ int main(int argc, char** argv)
dataOutChannel.UpdateType("push"); dataOutChannel.UpdateType("push");
dataOutChannel.UpdateMethod("bind"); dataOutChannel.UpdateMethod("bind");
dataOutChannel.UpdateAddress("tcp://127.0.0.1:5559"); dataOutChannel.UpdateAddress("tcp://127.0.0.1:5559");
if (argc == 2) if (transport == "nanomsg")
{ {
dataOutChannel.UpdateAddress("tcp://127.0.0.1:5759"); dataOutChannel.UpdateAddress("tcp://127.0.0.1:5759");
} }
@ -121,7 +131,7 @@ int main(int argc, char** argv)
dataInChannel.UpdateType("pull"); dataInChannel.UpdateType("pull");
dataInChannel.UpdateMethod("bind"); dataInChannel.UpdateMethod("bind");
dataInChannel.UpdateAddress("tcp://127.0.0.1:5560"); dataInChannel.UpdateAddress("tcp://127.0.0.1:5560");
if (argc == 2) if (transport == "nanomsg")
{ {
dataInChannel.UpdateAddress("tcp://127.0.0.1:5760"); dataInChannel.UpdateAddress("tcp://127.0.0.1:5760");
} }