[13.x] Fix sub-second process timeouts given as a CarbonInterval
Merged
XU
20d ago+32+32+01234567890123456789-4-4-0123456789
When a timeout shorter than one second is given as a CarbonInterval, the process runs with no timeout at all.
Process::timeout(CarbonInterval::milliseconds(500))->run('redis-cli ping');
This is expected to give up after half a second. Instead the interval is truncated to 0, which means "no timeout", so the command can hang forever.
Fractions are also dropped for longer intervals, so CarbonInterval::milliseconds(1900) becomes a 1 second timeout.