Skip to content

Commit cefbd50

Browse files
committed
tests: fixed mkdir() race condition
1 parent ef93f16 commit cefbd50

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/bootstrap.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,5 @@
1616

1717
// create temporary directory
1818
define('TEMP_DIR', __DIR__ . '/tmp/' . lcg_value());
19-
@mkdir(TEMP_DIR, 0777, TRUE); // @ - base directory may already exist
20-
register_shutdown_function(function () {
21-
Tester\Helpers::purge(TEMP_DIR);
22-
rmdir(TEMP_DIR);
23-
});
19+
@mkdir(dirname(TEMP_DIR));
20+
@mkdir(TEMP_DIR);

0 commit comments

Comments
 (0)