SIENTIAPDE-1141
fix: update execution counts and add schedule deletion logic in test.ipynb for improved error handling
This commit is contained in:
106
test.ipynb
106
test.ipynb
@@ -110,7 +110,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": 14,
|
||||
"id": "7d01f160",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -230,6 +230,87 @@
|
||||
")\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b840347d",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Error deleting schedule scouter-load-test-1: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-2: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-3: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-4: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-5: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-6: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-7: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-8: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-9: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-10: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-11: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-12: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-13: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-14: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-15: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-16: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-17: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-18: workflow execution already completed\n",
|
||||
"Error deleting schedule scouter-load-test-19: workflow execution already completed\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# Delete schedule by ID\n",
|
||||
"schedule_id = \"scouter-load-test-num\"\n",
|
||||
"\n",
|
||||
"for i in range(0, 70):\n",
|
||||
"\n",
|
||||
" try:\n",
|
||||
" handle = temporal_client.get_schedule_handle(\n",
|
||||
" schedule_id.replace(\"num\", str(i)))\n",
|
||||
" \n",
|
||||
" await handle.delete()\n",
|
||||
" except Exception as e:\n",
|
||||
" print(f\"Error deleting schedule {schedule_id.replace('num', str(i))}: {e}\")\n",
|
||||
"\n",
|
||||
"# Delete schedule by ID\n",
|
||||
"schedule_id = \"laborious-load-test-num\"\n",
|
||||
"\n",
|
||||
"for i in range(0, 70):\n",
|
||||
"\n",
|
||||
" try:\n",
|
||||
" handle = temporal_client.get_schedule_handle(\n",
|
||||
" schedule_id.replace(\"num\", str(i)))\n",
|
||||
" \n",
|
||||
" await handle.delete()\n",
|
||||
" except Exception as e:\n",
|
||||
" print(f\"Error deleting schedule {schedule_id.replace('num', str(i))}: {e}\")\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"id": "374b5b0e",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"scouter-load-test-num\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"schedule_id = \"scouter-load-test-num\"\n",
|
||||
"schedule_id.replace(\"-\", \"_\")\n",
|
||||
"\n",
|
||||
"print(schedule_id)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
@@ -299,6 +380,29 @@
|
||||
" "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"id": "f81b3728",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'_client': <temporalio.client.Client object at 0x770086544f90>, 'id': 'orchestrator'}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"async for schedule in await temporal_client.list_schedules():\n",
|
||||
" id = schedule.id\n",
|
||||
"\n",
|
||||
" handle = temporal_client.get_schedule_handle(id)\n",
|
||||
"\n",
|
||||
" print(vars(handle))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
|
||||
Reference in New Issue
Block a user