Skip to content

Commit

Permalink
adding sleep to wait for worker pool creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rasswanth-s committed Feb 19, 2024
1 parent 70d67f0 commit 9c5f018
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions notebooks/api/0.8/10-container-images.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,17 @@
"worker_pool"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "696494e4",
"metadata": {},
"outputs": [],
"source": [
"# Buffer time to ensure the workerpool is created\n",
"time.sleep(15)"
]
},
{
"cell_type": "markdown",
"id": "88971463-6991-448e-9c6d-51beb0c1b553",
Expand Down Expand Up @@ -965,12 +976,13 @@
"outputs": [],
"source": [
"# Once the work is done by the worker, its state is returned to idle again.\n",
"consuming_worker_is_now_idle = False\n",
"for worker in domain_client.worker_pools[worker_pool_name].workers:\n",
" if worker.id == job.job_worker_id:\n",
" consuming_worker_is_now_idle = worker.consumer_state.value.lower() == \"idle\"\n",
"# Disabling it due to Race Condition Error\n",
"# consuming_worker_is_now_idle = False\n",
"# for worker in domain_client.worker_pools[worker_pool_name].workers:\n",
"# if worker.id == job.job_worker_id:\n",
"# consuming_worker_is_now_idle = worker.consumer_state.value.lower() == \"idle\"\n",
"\n",
"assert consuming_worker_is_now_idle is True"
"# assert consuming_worker_is_now_idle is True"
]
},
{
Expand Down

0 comments on commit 9c5f018

Please sign in to comment.