diff --git a/unittests/consumer.py b/unittests/consumer.py
index c31386af82208882d51039fc31d3179f06f969ff..b66589f3236c5be02388ae382eebb864835d1af0 100644
--- a/unittests/consumer.py
+++ b/unittests/consumer.py
@@ -30,20 +30,21 @@ if serv.init(args["address"]) == -1:
 # serv_nextobjs
 count = 0
 per_req = math.ceil(args["objects"] / args["requests"])
+sleep_time = 3
 while count < args["objects"]:
     obj_list = serv.nextobjs(per_req)
     if ( isinstance(obj_list, list)):
-        count = count+obj_list.size()
+        count = count+len(obj_list)
         logging.info("New list of objects:")
         for obj in obj_list:
             logging.info(obj)
     elif obj_list == 0:
-        sleep_time = 3
         logging.info("Waiting for %ds on more objects, current count = %d" % (sleep_time, count))
         time.sleep(sleep_time)
     else:
-        logging.info("An error occurred while getting objects, final count = %d" % (count))
-        break
+        logging.info("An error occurred while getting objects, final count = %d, waiting" % (count))
+        time.sleep(sleep_time)
+
 logging.info("Total objects read = %d" % (count))
 
 serv.fini()