MCPcopy Create free account
hub / github.com/FastLED/FastLED / _run_parallel

Method _run_parallel

ci/util/running_process_group.py:202–430  ·  view source on GitHub ↗

Execute processes in parallel (based on test_runner._run_processes_parallel).

(self)

Source from the content-addressed store, hash-verified

200 raise ValueError(f"Unknown execution mode: {self.config.execution_mode}")
201
202 def _run_parallel(self) -> list[ProcessTiming]:
203 """Execute processes in parallel (based on test_runner._run_processes_parallel)."""
204 if not self.processes:
205 return []
206
207 # Create a shared output handler for formatting
208 ProcessOutputHandler(verbose=self.config.verbose)
209
210 # Configure Windows console for UTF-8 output if needed
211 if os.name == "nt": # Windows
212 if hasattr(sys.stdout, "reconfigure"):
213 sys.stdout.reconfigure(encoding="utf-8", errors="replace") # type: ignore
214 if hasattr(sys.stderr, "reconfigure"):
215 sys.stderr.reconfigure(encoding="utf-8", errors="replace") # type: ignore
216
217 # Track start times and enable status monitoring
218 self._status_monitoring_active = True
219 for proc in self.processes:
220 self._track_process_start(proc)
221
222 # Start processes that aren't already running
223 for proc in self.processes:
224 cmd_str = proc.get_command_str()
225 if proc.proc is None: # Only start if not already running
226 proc.start()
227 # Create user-friendly display message
228 display_msg = cmd_str
229 if "meson_example_runner" in cmd_str:
230 # Extract example names from command (after the .py script)
231 parts = cmd_str.split()
232 examples: list[str] = []
233 found_script = False
234 for p in parts:
235 if "meson_example_runner" in p:
236 found_script = True
237 continue
238 if not found_script:
239 continue
240 # Skip flags
241 if p.startswith("-"):
242 continue
243 examples.append(p)
244 if examples:
245 display_msg = f"Compiling: {', '.join(examples)}"
246 else:
247 display_msg = "Compiling examples"
248 elif "ci/util/" in cmd_str:
249 display_msg = cmd_str.split("ci/util/")[-1]
250 elif "ci\\" in cmd_str or "ci/" in cmd_str:
251 # Extract just the script name
252 parts = cmd_str.replace("\\", "/").split("/")
253 for i, part in enumerate(parts):
254 if part in ("ci", "util") and i + 1 < len(parts):
255 display_msg = "/".join(parts[i:])
256 break
257 print(f"{display_msg}", flush=True)
258 else:
259 print(f" Already running: {cmd_str}", flush=True)

Callers 1

runMethod · 0.95

Calls 15

_track_process_startMethod · 0.95
start_monitoringMethod · 0.95
_build_failure_listMethod · 0.95
_process_active_testsMethod · 0.95
shutdownMethod · 0.95
ProcessStuckMonitorClass · 0.90
TestFailureInfoClass · 0.90
_extract_test_nameFunction · 0.90

Tested by

no test coverage detected