def test_open_many_transactions_in_parallel(self): self.txs_closed = 0 with GraknClient.core() as client, client.session( "grakn", SessionType.DATA) as session: pool = ThreadPool(8) results = [None for _ in range(10)] pool.map(partial(self.open_tx, session), results) pool.close() pool.join()
def setUp(self): with GraknClient.core() as client: if not client.databases().contains("grakn"): client.databases().create("grakn")
def before_all(context: Context): environment_base.before_all(context) context.client = GraknClient.core()
def setUpClass(cls): super(TestClientPython, cls).setUpClass() global client client = GraknClient.core()
def setUp(self): with GraknClient.core() as client: if "grakn" not in client.databases().all(): client.databases().create("grakn")
def before_all(context: Context): context.THREAD_POOL_SIZE = 32 context.client = GraknClient.core()
def before_all(context: Context): environment_base.before_all(context) context.client = GraknClient.core(address="localhost:%d" % int(context.config.userdata["port"]))