FairMQ: Add uuid generator to tools & let tests use it for session names.

This commit is contained in:
Alexey Rybalchenko 2017-11-28 17:25:39 +01:00
parent 5b091f7eec
commit 76017e2148
4 changed files with 11 additions and 12 deletions

View File

@ -3,12 +3,10 @@ ex8config="@CMAKE_BINARY_DIR@/bin/config/ex8-multipart.json"
SAMPLER="ex8-sampler" SAMPLER="ex8-sampler"
SAMPLER+=" --id sampler1" SAMPLER+=" --id sampler1"
SAMPLER+=" --transport nanomsg"
SAMPLER+=" --mq-config $ex8config" SAMPLER+=" --mq-config $ex8config"
xterm -geometry 80x23+0+0 -hold -e gdb --args @CMAKE_BINARY_DIR@/bin/examples/MQ/8-multipart/$SAMPLER & xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/examples/MQ/8-multipart/$SAMPLER &
SINK="ex8-sink" SINK="ex8-sink"
SINK+=" --id sink1" SINK+=" --id sink1"
SINK+=" --transport nanomsg"
SINK+=" --mq-config $ex8config" SINK+=" --mq-config $ex8config"
xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/examples/MQ/8-multipart/$SINK & xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/examples/MQ/8-multipart/$SINK &

View File

@ -1,12 +1,12 @@
#!/bin/bash #!/bin/bash
config="@CMAKE_BINARY_DIR@/bin/config/ex-multiple-transports.json" config="@CMAKE_BINARY_DIR@/bin/config/ex-multiple-transports.json"
SESSION="$(@CMAKE_BINARY_DIR@/bin/uuidGen -h)"
trap 'kill -TERM $SAMPLER1_PID; kill -TERM $SAMPLER2_PID; kill -TERM $SINK_PID; wait $SAMPLER1_PID; wait $SAMPLER2_PID; wait $SINK_PID; @CMAKE_BINARY_DIR@/bin/shmmonitor --cleanup;' TERM trap 'kill -TERM $SAMPLER1_PID; kill -TERM $SAMPLER2_PID; kill -TERM $SINK_PID; wait $SAMPLER1_PID; wait $SAMPLER2_PID; wait $SINK_PID; @CMAKE_BINARY_DIR@/bin/shmmonitor --cleanup --session $SESSION;' TERM
@CMAKE_BINARY_DIR@/bin/shmmonitor --cleanup
SINK="ex-mt-sink" SINK="ex-mt-sink"
SINK+=" --id sink1" SINK+=" --id sink1"
SINK+=" --session $SESSION"
SINK+=" --max-iterations 1" SINK+=" --max-iterations 1"
SINK+=" --control static --log-color false" SINK+=" --control static --log-color false"
SINK+=" --transport shmem" SINK+=" --transport shmem"
@ -16,6 +16,7 @@ SINK_PID=$!
SAMPLER1="ex-mt-sampler1" SAMPLER1="ex-mt-sampler1"
SAMPLER1+=" --id sampler1" SAMPLER1+=" --id sampler1"
SAMPLER1+=" --session $SESSION"
SAMPLER1+=" --max-iterations 1" SAMPLER1+=" --max-iterations 1"
SAMPLER1+=" --control static --log-color false" SAMPLER1+=" --control static --log-color false"
SAMPLER1+=" --transport shmem" SAMPLER1+=" --transport shmem"
@ -25,6 +26,7 @@ SAMPLER1_PID=$!
SAMPLER2="ex-mt-sampler2" SAMPLER2="ex-mt-sampler2"
SAMPLER2+=" --id sampler2" SAMPLER2+=" --id sampler2"
SAMPLER2+=" --session $SESSION"
SAMPLER2+=" --max-iterations 1" SAMPLER2+=" --max-iterations 1"
SAMPLER2+=" --control static --log-color false" SAMPLER2+=" --control static --log-color false"
SAMPLER2+=" --transport nanomsg" SAMPLER2+=" --transport nanomsg"

View File

@ -77,6 +77,7 @@ void FairMQExampleRegionSampler::ResetTask()
{ {
LOG(DEBUG) << "waiting for all acknowledgements... (" << fNumUnackedMsgs << ")"; LOG(DEBUG) << "waiting for all acknowledgements... (" << fNumUnackedMsgs << ")";
this_thread::sleep_for(chrono::milliseconds(500)); this_thread::sleep_for(chrono::milliseconds(500));
LOG(DEBUG) << "done, still unacked: " << fNumUnackedMsgs;
} }
fRegion.reset(); fRegion.reset();
} }

View File

@ -1,17 +1,15 @@
#!/bin/bash #!/bin/bash
exRegionConfig="@CMAKE_BINARY_DIR@/bin/config/ex-region.json" exRegionConfig="@CMAKE_BINARY_DIR@/bin/config/ex-region.json"
msgSize="1000000" msgSize="1000000"
SESSION="$(@CMAKE_BINARY_DIR@/bin/uuidGen -h)"
# setup a trap to kill everything if the test fails/timeouts # setup a trap to kill everything if the test fails/timeouts
trap 'kill -TERM $SAMPLER_PID; kill -TERM $SINK_PID; wait $SAMPLER_PID; wait $SINK_PID; @CMAKE_BINARY_DIR@/bin/shmmonitor --cleanup --session region_test' TERM trap 'kill -TERM $SAMPLER_PID; kill -TERM $SINK_PID; wait $SAMPLER_PID; wait $SINK_PID; @CMAKE_BINARY_DIR@/bin/shmmonitor --cleanup --session $SESSION' TERM
@CMAKE_BINARY_DIR@/bin/shmmonitor --cleanup --session region_test
SAMPLER="ex-region-sampler" SAMPLER="ex-region-sampler"
SAMPLER+=" --id sampler1" SAMPLER+=" --id sampler1"
SAMPLER+=" --session region_test" SAMPLER+=" --session $SESSION"
SAMPLER+=" --control static --log-color false" SAMPLER+=" --control static --log-color false"
SAMPLER+=" --max-iterations 1" SAMPLER+=" --max-iterations 1"
SAMPLER+=" --msg-size $msgSize" SAMPLER+=" --msg-size $msgSize"
@ -22,7 +20,7 @@ SAMPLER_PID=$!
SINK="ex-region-sink" SINK="ex-region-sink"
SINK+=" --id sink1" SINK+=" --id sink1"
SINK+=" --session region_test" SINK+=" --session $SESSION"
SINK+=" --verbosity INFO" SINK+=" --verbosity INFO"
SINK+=" --control static --log-color false" SINK+=" --control static --log-color false"
SINK+=" --max-iterations 1" SINK+=" --max-iterations 1"