mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
If a subprocess gets killed by an OOM killer or whatever it should respawn and raise an InternalError
This commit is contained in:
@@ -58,3 +58,16 @@ def test_error_in_environment(evaluator, Script):
|
||||
# Jedi should still work.
|
||||
def_, = Script('str').goto_definitions()
|
||||
assert def_.name == 'str'
|
||||
|
||||
|
||||
def test_killed_subprocess(evaluator, Script):
|
||||
# Just kill the subprocess.
|
||||
evaluator.compiled_subprocess._compiled_subprocess._process.kill()
|
||||
# Since the process was terminated (and nobody knows about it) the first
|
||||
# Jedi call fails.
|
||||
with pytest.raises(jedi.InternalError):
|
||||
Script('str').goto_definitions()
|
||||
|
||||
def_, = Script('str').goto_definitions()
|
||||
# Jedi should now work again.
|
||||
assert def_.name == 'str'
|
||||
|
||||
Reference in New Issue
Block a user