From f633bb00c06c5e58f22b89a0d6cbd70470e11be3 Mon Sep 17 00:00:00 2001 From: Alexandre Gobbo Date: Thu, 10 Oct 2019 14:29:40 +0200 Subject: [PATCH] Script execution --- script/test/TestZMQ2.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/script/test/TestZMQ2.py b/script/test/TestZMQ2.py index 7b7abbe..61d1b4e 100644 --- a/script/test/TestZMQ2.py +++ b/script/test/TestZMQ2.py @@ -6,19 +6,31 @@ providers, streams = [], [] for i in range(9000, 9008): p = Provider("Provider"+str(i),"tcp://SFTEST-CVME-DBPM1:"+str(i), SocketType.PULL) p.initialize() - providers.add(p) + providers.append(p) s = Stream("Stream"+str(i), p) s.initialize() - streams.add(s) - - - + streams.append(s) +def check(s): + print "Starting checking " + s.getName() + pid = s.take().pulseId + while(True): + s.waitCacheChange(10000) + p=s.take().pulseId + if p!= pid + 1: + print s.getName() + " error: received pid %d, expecting %d" % (p, (pid + 1)) + pid = p + try: for s in streams: s.start(True) s.waitCacheChange(5000) print s.getName() + " channels:" + str(s.getIdentifiers()) + args = [] + for s in streams: + args.append((check,(s,))) + parallelize(*args) + finally: try: for s in streams: