Skip to content

Commit 38ba709

Browse files
Update benchmark/Benchmark.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a261af3 commit 38ba709

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

benchmark/Benchmark.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ private function benchmarkPersistence(array $documents, int $n): array
377377
$this->log(" Benchmarking save/open...\n");
378378

379379
$tmpDir = sys_get_temp_dir() . '/phpvbench_' . uniqid('', true);
380-
mkdir($tmpDir, 0755, true);
380+
if (!is_dir($tmpDir) && !mkdir($tmpDir, 0755, true) && !is_dir($tmpDir)) {
381+
throw new \RuntimeException(sprintf('Failed to create temporary benchmark directory "%s".', $tmpDir));
382+
}
381383

382384
// Save
383385
$saveMeasurement = $this->measure(function () use ($documents, $tmpDir): void {

0 commit comments

Comments
 (0)