| 1 |
From: "Michael R. Crusoe" <[email protected]> |
| 2 |
Date: Tue, 15 Sep 2026 15:25:37 +0200 |
| 3 |
Subject: riscv64: increase worker start timeout (#21988) |
| 4 |
Origin: upstream, https://github.com/python/mypy/pull/21988 |
| 5 |
|
| 6 |
Fixes: #21969 |
| 7 |
|
| 8 |
Increases `WORKER_START_TIMEOUT` on riscv64 machines, allowing |
| 9 |
`--num-workers` with 1 or greater to work. |
| 10 |
--- |
| 11 |
mypy/defaults.py | 11 +++++++---- |
| 12 |
1 file changed, 7 insertions(+), 4 deletions(-) |
| 13 |
|
| 14 |
--- mypy.orig/mypy/defaults.py |
| 15 |
+++ mypy/mypy/defaults.py |
| 16 |
@@ -1,6 +1,7 @@ |
| 17 |
from __future__ import annotations |
| 18 |
|
| 19 |
import os |
| 20 |
+import platform |
| 21 |
import sys |
| 22 |
from typing import Final |
| 23 |
|
| 24 |
@@ -47,10 +48,12 @@ |
| 25 |
|
| 26 |
RECURSION_LIMIT: Final = 2**14 |
| 27 |
|
| 28 |
-# It looks like Windows is slow with processes, causing test flakiness even |
| 29 |
-# with our generous timeouts, so we set them higher. |
| 30 |
-WORKER_START_INTERVAL: Final = 0.01 if sys.platform != "win32" else 0.03 |
| 31 |
-WORKER_START_TIMEOUT: Final = 3 if sys.platform != "win32" else 10 |
| 32 |
+# It looks like Windows & riscv64 are both slow with processes, causing test |
| 33 |
+# flakiness even with our generous timeouts, so we set them higher. |
| 34 |
+slow_fs = sys.platform == "win32" or platform.machine() == "riscv64" |
| 35 |
+ |
| 36 |
+WORKER_START_INTERVAL: Final = 0.03 if slow_fs else 0.01 |
| 37 |
+WORKER_START_TIMEOUT: Final = 10 if slow_fs else 3 |
| 38 |
WORKER_SHUTDOWN_TIMEOUT: Final = 1 if sys.platform != "win32" else 3 |
| 39 |
|
| 40 |
WORKER_CONNECTION_TIMEOUT: Final = 10 |