Skip to content

Commit 0cb3074

Browse files
committed
Try short socket paths in tests, when long path is too long
1 parent 3c183a8 commit 0cb3074

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

sapi/fpm/tests/tester.inc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,9 +1155,19 @@ class Tester
11551155
return $address;
11561156
}
11571157

1158-
return sys_get_temp_dir() . '/' .
1159-
hash('crc32', dirname($address)) . '-' .
1160-
basename($address);
1158+
$addressPart = hash('crc32', dirname($address)) . '-' . basename($address);
1159+
1160+
// is longer on Mac, than on Linux
1161+
$tmpDirAddress = sys_get_temp_dir() . '/' . $addressPart;
1162+
;
1163+
1164+
if (strlen($tmpDirAddress) <= 104) {
1165+
return $tmpDirAddress;
1166+
}
1167+
1168+
$srcRootAddress = dirname(__DIR__, 3) . '/' . $addressPart;
1169+
1170+
return $srcRootAddress;
11611171
}
11621172

11631173
return $this->getHost($type) . ':' . $port;

0 commit comments

Comments
 (0)