77
88from pytest import fixture
99from comfy_execution .graph_utils import GraphBuilder
10- from tests .inference .test_execution import ComfyClient
10+ from tests .inference .test_execution import ComfyClient , run_warmup
1111
1212
1313@pytest .mark .execution
@@ -24,6 +24,7 @@ def _server(self, args_pytest, request):
2424 '--listen' , args_pytest ["listen" ],
2525 '--port' , str (args_pytest ["port" ]),
2626 '--extra-model-paths-config' , 'tests/inference/extra_model_paths.yaml' ,
27+ '--cpu' ,
2728 ]
2829 use_lru , lru_size = request .param
2930 if use_lru :
@@ -82,6 +83,9 @@ def test_basic_async_execution(self, client: ComfyClient, builder: GraphBuilder)
8283
8384 def test_multiple_async_parallel_execution (self , client : ComfyClient , builder : GraphBuilder ):
8485 """Test that multiple async nodes execute in parallel."""
86+ # Warmup execution to ensure server is fully initialized
87+ run_warmup (client )
88+
8589 g = builder
8690 image = g .node ("StubImage" , content = "BLACK" , height = 512 , width = 512 , batch_size = 1 )
8791
@@ -148,6 +152,9 @@ def test_async_validate_inputs(self, client: ComfyClient, builder: GraphBuilder)
148152
149153 def test_async_lazy_evaluation (self , client : ComfyClient , builder : GraphBuilder ):
150154 """Test async nodes with lazy evaluation."""
155+ # Warmup execution to ensure server is fully initialized
156+ run_warmup (client , prefix = "warmup_lazy" )
157+
151158 g = builder
152159 input1 = g .node ("StubImage" , content = "BLACK" , height = 512 , width = 512 , batch_size = 1 )
153160 input2 = g .node ("StubImage" , content = "WHITE" , height = 512 , width = 512 , batch_size = 1 )
@@ -305,6 +312,9 @@ def test_async_with_execution_blocker(self, client: ComfyClient, builder: GraphB
305312
306313 def test_async_caching_behavior (self , client : ComfyClient , builder : GraphBuilder ):
307314 """Test that async nodes are properly cached."""
315+ # Warmup execution to ensure server is fully initialized
316+ run_warmup (client , prefix = "warmup_cache" )
317+
308318 g = builder
309319 image = g .node ("StubImage" , content = "BLACK" , height = 512 , width = 512 , batch_size = 1 )
310320 sleep_node = g .node ("TestSleep" , value = image .out (0 ), seconds = 0.2 )
@@ -324,6 +334,9 @@ def test_async_caching_behavior(self, client: ComfyClient, builder: GraphBuilder
324334
325335 def test_async_with_dynamic_prompts (self , client : ComfyClient , builder : GraphBuilder ):
326336 """Test async nodes within dynamically generated prompts."""
337+ # Warmup execution to ensure server is fully initialized
338+ run_warmup (client , prefix = "warmup_dynamic" )
339+
327340 g = builder
328341 image1 = g .node ("StubImage" , content = "BLACK" , height = 512 , width = 512 , batch_size = 1 )
329342 image2 = g .node ("StubImage" , content = "WHITE" , height = 512 , width = 512 , batch_size = 1 )
0 commit comments