PY-36882 Fix debugger not working properly with joblib.Parallel when using loky backend

GitOrigin-RevId: 392e04e2e10ae404caf8c561a7c951e7eaea3c9c
This commit is contained in:
Andrey Lisin
2024-01-11 18:52:11 +00:00
committed by intellij-monorepo-bot
parent 4825ffe8e2
commit 1199e0bdaa
4 changed files with 40 additions and 2 deletions
@@ -291,6 +291,8 @@ class ReaderThread(PyDBDaemonThread):
while not self.killReceived:
try:
r = self.sock.recv(1024)
except OSError:
return
except:
if not self.killReceived:
traceback.print_exc()
+2 -2
View File
@@ -178,8 +178,8 @@ envs {
createPython("python3.11",
python311version,
["black == 23.1.0"],
"python3.11\nblack",
["black == 23.1.0", "joblib"],
"python3.11\nblack\njoblib",
true)
createPython("python3.12",
+8
View File
@@ -0,0 +1,8 @@
from joblib import Parallel, delayed
def f(i):
print(i)
return i*i
Parallel(n_jobs=2, backend='loky')(delayed(f)(i) for i in range(3))
@@ -340,4 +340,32 @@ public class PythonDebuggerMultiprocessingTest extends PyEnvTestCase {
}
});
}
@Test
@TestFor(issues = "PY-36882")
public void testNoErrorMessagesWithJoblib() {
runPythonTest(new PyDebuggerMultiprocessTask("/debug", "test_joblib.py") {
@Override
public void before() {
toggleBreakpoint(4);
}
@Override
public void testing() throws Exception {
waitForPause();
resume();
waitForPause();
resume();
waitForPause();
resume();
waitForTerminate();
assertFalse(output().contains("Traceback"));
}
@Override
public @NotNull Set<String> getTags() {
return Collections.singleton("joblib");
}
});
}
}