Skip to content

Commit

Permalink
tests: fixed mkdir() race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 4, 2017
1 parent 447201d commit 9e332a0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@

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


function test(\Closure $function)
Expand Down

0 comments on commit 9e332a0

Please sign in to comment.