فهرست منبع

Reset MPFuture state in tests

Aleksandr Borzunov 4 سال پیش
والد
کامیت
7a52b84847
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      tests/conftest.py

+ 3 - 1
tests/conftest.py

@@ -29,6 +29,8 @@ def cleanup_children():
             with suppress(psutil.NoSuchProcess):
                 child.kill()
 
-    # Killing child processes may leave the global MPFuture locks acquired, so we recreate them
+    # Killing child processes may leave the global locks in MPFuture acquired
+    # or the global state broken, so we reset them
     MPFuture._initialization_lock = mp.Lock()
     MPFuture._update_lock = mp.Lock()
+    MPFuture._active_pid = None  # This will force to reset the global state