Skip to content

Commit 7c9f6dc

Browse files
committed
parallel: Silent test for pause=
1 parent f359bdf commit 7c9f6dc

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

nbs/03a_parallel.ipynb

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -475,25 +475,15 @@
475475
"cell_type": "code",
476476
"execution_count": null,
477477
"metadata": {},
478-
"outputs": [
479-
{
480-
"name": "stdout",
481-
"output_type": "stream",
482-
"text": [
483-
"0 2023-02-14 20:40:39.098928\n",
484-
"1 2023-02-14 20:40:39.350350\n",
485-
"2 2023-02-14 20:40:39.601602\n",
486-
"3 2023-02-14 20:40:39.851952\n",
487-
"4 2023-02-14 20:40:40.102687\n"
488-
]
489-
}
490-
],
478+
"outputs": [],
491479
"source": [
492480
"def print_time(i): \n",
493-
" time.sleep(random.random()/1000)\n",
494-
" print(i, datetime.now())\n",
481+
" time.sleep(random.random()/100)\n",
482+
" return datetime.now()\n",
495483
"\n",
496-
"parallel(print_time, range(5), n_workers=2, pause=0.25);"
484+
"res = parallel(print_time, range(5), n_workers=2, pause=0.25)\n",
485+
"test_eq(len(res), 5)\n",
486+
"test_eq(res, sorted(res)) # Confirm that task end time increases monotonically"
497487
]
498488
},
499489
{

0 commit comments

Comments
 (0)