Fix tests not able to run in parallel
Reusing filenames is bad.
Esse commit está contido em:
@@ -8,13 +8,13 @@
|
||||
$file_path = dirname(__FILE__);
|
||||
|
||||
echo "*** Test tempnam() function: by passing an existing filename as prefix ***\n";
|
||||
$dir_name = $file_path."/tempnam_variation6";
|
||||
$dir_name = $file_path."/tempnam_variation5";
|
||||
mkdir($dir_name);
|
||||
$h = fopen($dir_name."/tempnam_variation6.tmp", "w");
|
||||
$h = fopen($dir_name."/tempnam_variation5.tmp", "w");
|
||||
|
||||
for($i=1; $i<=3; $i++) {
|
||||
echo "-- Iteration $i --\n";
|
||||
$created_file = tempnam("$dir_name", "tempnam_variation6.tmp");
|
||||
$created_file = tempnam("$dir_name", "tempnam_variation5.tmp");
|
||||
|
||||
if( file_exists($created_file) ) {
|
||||
echo "File name is => ";
|
||||
@@ -27,7 +27,7 @@ for($i=1; $i<=3; $i++) {
|
||||
unlink($created_file);
|
||||
}
|
||||
fclose($h);
|
||||
unlink($dir_name."/tempnam_variation6.tmp");
|
||||
unlink($dir_name."/tempnam_variation5.tmp");
|
||||
rmdir($dir_name);
|
||||
|
||||
echo "\n*** Done ***\n";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
*** Test tempnam() function: by passing an existing filename as prefix ***
|
||||
-- Iteration 1 --
|
||||
File name is => %stempnam_variation6%etempnam_variation6.tmp%s
|
||||
File name is => %stempnam_variation5%etempnam_variation5.tmp%s
|
||||
-- Iteration 2 --
|
||||
File name is => %stempnam_variation6%etempnam_variation6.tmp%s
|
||||
File name is => %stempnam_variation5%etempnam_variation5.tmp%s
|
||||
-- Iteration 3 --
|
||||
File name is => %stempnam_variation6%etempnam_variation6.tmp%s
|
||||
File name is => %stempnam_variation5%etempnam_variation5.tmp%s
|
||||
|
||||
*** Done ***
|
||||
@@ -405,6 +405,10 @@ def walk(filename, source):
|
||||
file(full_dest_filename+'.expectregex', 'w').write(exp)
|
||||
elif sections.has_key('EXPECTF'):
|
||||
exp = sections['EXPECTF']
|
||||
|
||||
if '/ext-standard-file/tempnam_variation5.php' in full_dest_filename:
|
||||
exp = exp.replace('tempnam_variation6', 'tempnam_variation5')
|
||||
|
||||
file(full_dest_filename+'.expectf', 'w').write(exp)
|
||||
else:
|
||||
print "Malformed test, no --EXPECT*--: ", filename
|
||||
@@ -525,6 +529,9 @@ def walk(filename, source):
|
||||
test = test.replace('dirname(__FILE__)', '__DIR__."/../../../sample_dir/"')
|
||||
if '/ext-standard-file/lchgrp_basic.php' in full_dest_filename:
|
||||
test = test.replace('symlink.txt', 'lchgrp_basic_symlink.txt')
|
||||
if '/ext-standard-file/tempnam_variation5.php' in full_dest_filename:
|
||||
test = test.replace('tempnam_variation6', 'tempnam_variation5')
|
||||
|
||||
|
||||
file(full_dest_filename, 'w').write(test)
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário