Skip to content

Commit e87f5ec

Browse files
committed
FIX(exe.TC): actually TaskCtxt fails in all Parallels
1 parent 9207f92 commit e87f5ec

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

test/test_graphtik.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from operator import add, floordiv, mul, sub
1818
from pprint import pprint
1919
from textwrap import dedent
20+
from time import sleep
2021
from typing import Tuple
2122
from unittest.mock import MagicMock
2223

@@ -308,22 +309,27 @@ def powers_in_range(a, exponent):
308309

309310
def test_task_context(exemethod, request):
310311
def check_task_context():
311-
assert task_context.get().op == next(iop)
312+
sleep(0.1)
313+
assert task_context.get().op == next(iop), "Corrupted task-context"
312314

313-
n_ops = 30
315+
n_ops = 10
314316
pipe = compose(
315317
"t",
316-
*(operation(check_task_context, f"op{i}", provides="a") for i in range(n_ops)),
318+
*(
319+
operation(check_task_context, f"op{i}", provides=f"{i}")
320+
for i in range(n_ops)
321+
),
317322
parallel=exemethod,
318323
)
319324
iop = iter(pipe.ops)
320325

321326
print(_exe_params)
322327
err = None
323-
if _exe_params.parallel and _exe_params.marshal:
324-
err = AssertionError("^assert FunctionalOperation")
325328
if _exe_params.proc and _exe_params.marshal:
326329
err = Exception("^Error sending result")
330+
elif _exe_params.parallel:
331+
err = AssertionError("^Corrupted task-context")
332+
327333
if err:
328334
with pytest.raises(type(err), match=str(err)):
329335
pipe.compute()

0 commit comments

Comments
 (0)