Ejemplo n.º 1
0
 def check_leak(self, request, client):
     assert fiber.active_children() == []
     if fiber.config.default_backend != "docker":
         yield
         return
     pre_workers = client.containers.list()
     yield
     post_workers = client.containers.list()
     assert pre_workers == post_workers
Ejemplo n.º 2
0
 def test_active_children(self):
     # Reset fiber module so other processes won't inteference with
     # current run
     import importlib
     importlib.reload(fiber)
     fiber.process._children = set()
     try:
         p1 = Process(target=time.sleep,
                      args=(1, ),
                      name="test_active_children1")
         p1.start()
         p2 = Process(target=time.sleep,
                      args=(1, ),
                      name="test_active_children2")
         p2.start()
         assert len(fiber.active_children()) == 2
     finally:
         p1.join()
         p2.join()
Ejemplo n.º 3
0
 def check_leak(self, request, client):
     assert fiber.active_children() == []
     pre_workers = client.containers.list()
     yield
     post_workers = client.containers.list()
     assert pre_workers == post_workers