Fix nanomsg tests

This commit is contained in:
Alexey Rybalchenko
2017-02-27 16:40:07 +01:00
committed by Mohammad Al-Turany
parent 07b760218f
commit c78b7e4cfa
7 changed files with 77 additions and 17 deletions

View File

@@ -12,11 +12,13 @@
* @author A. Rybalchenko
*/
#include <string>
#include "FairMQLogger.h"
#include "FairMQTestSub.h"
#include <string>
#include <chrono>
#include <thread>
int main(int argc, char** argv)
{
reinit_logger(false);
@@ -70,6 +72,12 @@ int main(int argc, char** argv)
testSub.ChangeState("RUN");
testSub.WaitForEndOfState("RUN");
// nanomsg does not implement the LINGER option. Give the sockets some time before their queues are terminated
if (transport == "nanomsg")
{
std::this_thread::sleep_for(std::chrono::seconds(1));
}
testSub.ChangeState("RESET_TASK");
testSub.WaitForEndOfState("RESET_TASK");