def clientThread(self, harness, passIndex, threadIndex, totalThreadCount,
                        successList, failureList, connectedThreads, connectedThreadEvent,
                        viewList,
                        blockUntilConnected
                        ):
        try:
            logging.info("Connecting to SharedState in thread %s", threadIndex)
            try:
                view = harness.newView()
                viewList.append(view)
            finally:
                connectedThreads.append(threadIndex)

                if len(connectedThreads) == totalThreadCount:
                    connectedThreadEvent.set()
                    logging.debug("All reconnection test threads have connected.")


            if blockUntilConnected:
                connectedThreadEvent.wait()

            logging.info("Have view in thread %s", threadIndex)

            logging.info("Connected to shared state in thread %s", threadIndex)

            harness.subscribeToKeyspace(view, NativeJson.Json("data"))

            harness.writeToKeyspace(
                view,
                NativeJson.Json("data"),
                NativeJson.Json(str(threadIndex)),
                NativeJson.Json(str(passIndex))
                )

            t0 = time.time()

            while True:
                itemDict = dict(harness.getAllItemsFromView(view, NativeJson.Json("data")))

                allAreCurPass = True
                if len(itemDict) == totalThreadCount:
                    for i in itemDict:
                        if itemDict[i] != NativeJson.Json(str(passIndex)):
                            allAreCurPass = False

                if allAreCurPass:
                    successList.append(threadIndex)
                    return

                time.sleep(.01)
                if time.time() - t0 > 5.0:
                    failureList.append("Bad dict: %s" % itemDict)
                    return

            view.flush()
        except:
            failureList.append("Exception: " + traceback.format_exc())
dataset/ETHPy150Open ufora/ufora/ufora/distributed/SharedState/SharedState_test.py/TestSharedState.clientThread/original