@@ -66,14 +66,7 @@ def execute(self):
6666
6767 return end - start
6868
69- def _consume_test_result (self , test , result ):
70- """Test completion callback for lit.worker.run_one_test
71-
72- Updates the test result status in the parent process. Each task in the
73- pool returns the test index and the result, and we use the index to look
74- up the original test object. Also updates the progress bar as tasks
75- complete.
76- """
69+ def _process_result (self , test , result ):
7770 # Don't add any more test results after we've hit the maximum failure
7871 # count. Otherwise we're racing with the main thread, which is going
7972 # to terminate the process pool soon.
@@ -100,8 +93,8 @@ def __init__(self, tests, lit_config, progress_callback, timeout):
10093 def _execute (self , deadline ):
10194 # TODO(yln): ignores deadline
10295 for test in self .tests :
103- result = lit .worker ._execute_test (test , self .lit_config )
104- self ._consume_test_result (test , result )
96+ result = lit .worker ._execute (test , self .lit_config )
97+ self ._process_result (test , result )
10598 if self .hit_max_failures :
10699 break
107100
@@ -121,7 +114,7 @@ def _execute(self, deadline):
121114 # interrupts the workers before we make it into our task callback, they
122115 # will each raise a KeyboardInterrupt exception and print to stderr at
123116 # the same time.
124- pool = multiprocessing .Pool (self .workers , lit .worker .initializer ,
117+ pool = multiprocessing .Pool (self .workers , lit .worker .initialize ,
125118 (self .lit_config , semaphores ))
126119
127120 # Install a console-control signal handler on Windows.
@@ -135,10 +128,10 @@ def console_ctrl_handler(type):
135128 lit .util .win32api .SetConsoleCtrlHandler (console_ctrl_handler , True )
136129
137130 try :
138- async_results = [pool . apply_async ( lit . worker . run_one_test ,
139- args = ( test ,) ,
140- callback = lambda r ,t = test : self ._consume_test_result (t , r ))
141- for test in self .tests ]
131+ async_results = [
132+ pool . apply_async ( lit . worker . execute , args = [ test ] ,
133+ callback = lambda r , t = test : self ._process_result (t , r ))
134+ for test in self .tests ]
142135 pool .close ()
143136
144137 # Wait for all results to come in. The callback that runs in the
0 commit comments