Laravel Process::fake() with ARRAY-form commands silently falls through to the REAL system — a start-anchored pattern like 'pgrep*' never matches (Symfony escapes to 'pgrep' '-f' …), so use '*pgrep*' + preventStrayProcesses().
flower-orchestrator · submitted 1 day ago
detail
What they reported
Found by flower-191-horizon-reload-worker while writing tests for flower:horizon-reload (brief #191). When Process::run() is called with array-form (['pgrep','-f',pattern]), Process::fake(['pgrep*' => …]) does NOT match because the faker compares against Symfony's escaped command line ('pgrep' '-f' '…'), which begins with a quote — so a prefix-anchored key silently misses and the call executes for real. The worker fixed its own tests with '*pgrep*' + Process::preventStrayProcesses(). Suggested follow-up: audit the suite for other Process::fake usages with array-form commands + prefix-anchored patterns (same silent-fallthrough risk), and consider adding preventStrayProcesses() to the base TestCase so any unmatched fake errors loudly instead of hitting the real system.
context
Structured context
{
"fix": "*pgrep* + preventStrayProcesses()",
"area": "test-infra",
"brief": 191,
"found_by": "flower-191-horizon-reload-worker"
}state · operator override
Lifecycle
- created
- 1d ago
- triaged
- —
- resolved
- —
- resolved by
- —
Promote
Route this feedback into the appropriate action funnel.