Commit cc0a96c
committed
Run dask with a matching interpreter
When Debian is in the process of migrating from one Python version to
another, there's a transitional period when we run tests on each of two
Python versions, although `/usr/bin/python3` can only point to one at a
time. `distributed` runs `dask` from the executable search path, and
when it's installed as a system package rather than in a virtual
environment, it's possible during this transitional period for
`distributed` to be running under (e.g.) Python 3.13 while
`/usr/bin/dask` has a `#!` line that causes it to be run under (e.g.)
Python 3.12. This results in the following obscure failure mode in some
tests in `distributed/deploy/tests/test_subprocess.py`:
______________________________ test_basic ______________________________
@pytest.mark.skipif(WINDOWS, reason="distributed#7434")
@gen_test()
async def test_basic():
async with SubprocessCluster(
asynchronous=True,
dashboard_address=":0",
scheduler_kwargs={"idle_timeout": "5s"},
worker_kwargs={"death_timeout": "5s"},
) as cluster:
async with Client(cluster, asynchronous=True) as client:
> result = await client.submit(lambda x: x + 1, 10)
distributed/deploy/tests/test_subprocess.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Future: cancelled, key: lambda-e426db6b5bc630ab037e145b5e8f631c>, raiseit = True
async def _result(self, raiseit=True):
await self._state.wait()
if self.status == "error":
exc = clean_exception(self._state.exception, self._state.traceback)
if raiseit:
typ, exc, tb = exc
> raise exc.with_traceback(tb)
E SystemError: no locals found when setting up annotations
distributed/client.py:410: SystemError
Explicitly running `dask` using `sys.executable` fixes this. It's only
_strictly_ necessary to change the invocations of `dask` in
`distributed.deploy.subprocess`, but it seemed better to apply the same
change to the whole codebase for consistency.1 parent 8f1b241 commit cc0a96c
File tree
10 files changed
+334
-40
lines changed- distributed
- cli/tests
- comm/tests
- deploy
- tests
10 files changed
+334
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
| |||
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
68 | | - | |
| 78 | + | |
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
| |||
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
79 | | - | |
| 89 | + | |
80 | 90 | | |
81 | 91 | | |
82 | 92 | | |
| |||
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
| 122 | + | |
| 123 | + | |
112 | 124 | | |
113 | 125 | | |
114 | 126 | | |
| |||
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
| 152 | + | |
| 153 | + | |
140 | 154 | | |
141 | 155 | | |
142 | 156 | | |
| |||
158 | 172 | | |
159 | 173 | | |
160 | 174 | | |
| 175 | + | |
| 176 | + | |
161 | 177 | | |
162 | 178 | | |
163 | 179 | | |
| |||
198 | 214 | | |
199 | 215 | | |
200 | 216 | | |
| 217 | + | |
| 218 | + | |
201 | 219 | | |
202 | 220 | | |
203 | 221 | | |
| |||
208 | 226 | | |
209 | 227 | | |
210 | 228 | | |
| 229 | + | |
| 230 | + | |
211 | 231 | | |
212 | 232 | | |
213 | 233 | | |
| |||
252 | 272 | | |
253 | 273 | | |
254 | 274 | | |
255 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
256 | 286 | | |
257 | 287 | | |
258 | 288 | | |
259 | 289 | | |
260 | 290 | | |
| 291 | + | |
| 292 | + | |
261 | 293 | | |
262 | 294 | | |
263 | 295 | | |
| |||
273 | 305 | | |
274 | 306 | | |
275 | 307 | | |
| 308 | + | |
| 309 | + | |
276 | 310 | | |
277 | 311 | | |
278 | 312 | | |
| |||
292 | 326 | | |
293 | 327 | | |
294 | 328 | | |
| 329 | + | |
| 330 | + | |
295 | 331 | | |
296 | 332 | | |
297 | 333 | | |
| |||
329 | 365 | | |
330 | 366 | | |
331 | 367 | | |
| 368 | + | |
| 369 | + | |
332 | 370 | | |
333 | 371 | | |
334 | 372 | | |
| |||
359 | 397 | | |
360 | 398 | | |
361 | 399 | | |
| 400 | + | |
| 401 | + | |
362 | 402 | | |
363 | 403 | | |
364 | 404 | | |
| |||
382 | 422 | | |
383 | 423 | | |
384 | 424 | | |
| 425 | + | |
| 426 | + | |
385 | 427 | | |
386 | 428 | | |
387 | 429 | | |
| |||
408 | 450 | | |
409 | 451 | | |
410 | 452 | | |
411 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
412 | 456 | | |
413 | 457 | | |
414 | 458 | | |
| |||
446 | 490 | | |
447 | 491 | | |
448 | 492 | | |
| 493 | + | |
| 494 | + | |
449 | 495 | | |
450 | 496 | | |
451 | 497 | | |
| |||
477 | 523 | | |
478 | 524 | | |
479 | 525 | | |
480 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
481 | 536 | | |
482 | 537 | | |
483 | 538 | | |
| |||
530 | 585 | | |
531 | 586 | | |
532 | 587 | | |
533 | | - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
534 | 597 | | |
535 | 598 | | |
536 | 599 | | |
| 600 | + | |
| 601 | + | |
537 | 602 | | |
538 | 603 | | |
539 | 604 | | |
| |||
555 | 620 | | |
556 | 621 | | |
557 | 622 | | |
558 | | - | |
559 | | - | |
560 | | - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
561 | 654 | | |
562 | 655 | | |
563 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| 82 | + | |
| 83 | + | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
| |||
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
88 | | - | |
| 97 | + | |
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
| |||
97 | 106 | | |
98 | 107 | | |
99 | 108 | | |
| 109 | + | |
| 110 | + | |
100 | 111 | | |
101 | 112 | | |
102 | 113 | | |
| |||
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
| 150 | + | |
| 151 | + | |
139 | 152 | | |
140 | 153 | | |
141 | 154 | | |
| |||
0 commit comments