From: ptarjan Date: Thu, 26 Sep 2013 07:18:05 +0000 (-0700) Subject: fix many parallel test issues X-Git-Tag: php-5.6.0alpha1~211^2~51^2~4^2^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ecbe4af0de94c629fa5ba8ab169654e00c958bad;p=php fix many parallel test issues While running these on HHVM I've run into a lot of parallelism issues. I'm backporting all the fixes I had to do in https://github.com/facebook/hiphop-php/blob/master/hphp/tools/import_zend_test.py#L650 to php core. Most of these changes were just filenames that were shared between tests, but I did more surgery on the fixed ports. I can apreciate port 31337 as much as the next nerd, but random ports are better for tests. --- diff --git a/ext/ftp/tests/ftp_fget_basic1.phpt b/ext/ftp/tests/ftp_fget_basic1.phpt index 475f7183d2..5909d35cef 100644 --- a/ext/ftp/tests/ftp_fget_basic1.phpt +++ b/ext/ftp/tests/ftp_fget_basic1.phpt @@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); ftp_set_option($ftp, FTP_AUTOSEEK, false); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt"; $handle = fopen($local_file, 'w'); var_dump(ftp_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME)); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_fget_basic2.phpt b/ext/ftp/tests/ftp_fget_basic2.phpt index 00a26752d9..622cea3683 100644 --- a/ext/ftp/tests/ftp_fget_basic2.phpt +++ b/ext/ftp/tests/ftp_fget_basic2.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_fget_basic3.phpt b/ext/ftp/tests/ftp_fget_basic3.phpt index b7098701ab..9485473b1c 100644 --- a/ext/ftp/tests/ftp_fget_basic3.phpt +++ b/ext/ftp/tests/ftp_fget_basic3.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_nb_fget_basic1.phpt b/ext/ftp/tests/ftp_nb_fget_basic1.phpt index cac4eec56b..5e6389ff13 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic1.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic1.phpt @@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); ftp_set_option($ftp, FTP_AUTOSEEK, false); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt"; $handle = fopen($local_file, 'w'); var_dump(ftp_nb_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME)); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_fget_basic2.phpt b/ext/ftp/tests/ftp_nb_fget_basic2.phpt index dc92f4e23b..215b79ac4a 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic2.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic2.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_fget_basic3.phpt b/ext/ftp/tests/ftp_nb_fget_basic3.phpt index d1a87c4f3d..66daf2ba0a 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic3.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic3.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_get_large.phpt b/ext/ftp/tests/ftp_nb_get_large.phpt index 3fbf2a4831..0c354d7c19 100644 --- a/ext/ftp/tests/ftp_nb_get_large.phpt +++ b/ext/ftp/tests/ftp_nb_get_large.phpt @@ -18,7 +18,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt"; touch($local_file); ftp_nb_get($ftp, $local_file, 'fget_large.txt', FTP_BINARY, 5368709119); $fp = fopen($local_file, 'r'); @@ -29,7 +29,7 @@ fclose($fp); ?> --CLEAN-- --EXPECT-- string(1) "X" diff --git a/ext/spl/tests/SplFileObject_getflags_basic.phpt b/ext/spl/tests/SplFileObject_getflags_basic.phpt index 5addadf380..88cf6861a2 100644 --- a/ext/spl/tests/SplFileObject_getflags_basic.phpt +++ b/ext/spl/tests/SplFileObject_getflags_basic.phpt @@ -7,16 +7,16 @@ Erwin Poeze --FILE-- setFlags(SplFileObject::DROP_NEW_LINE); var_dump($fo->getFlags()); ?> --CLEAN-- --EXPECT-- int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error001.phpt b/ext/spl/tests/SplFileObject_getflags_error001.phpt index 1602f88885..ca53c857e7 100644 --- a/ext/spl/tests/SplFileObject_getflags_error001.phpt +++ b/ext/spl/tests/SplFileObject_getflags_error001.phpt @@ -7,10 +7,10 @@ Erwin Poeze --FILE-- setFlags(SplFileObject::READ_CSV); $fo->setFlags(SplFileObject::DROP_NEW_LINE); @@ -20,7 +20,7 @@ var_dump($fo->getFlags()); ?> --CLEAN-- --EXPECT-- int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error002.phpt b/ext/spl/tests/SplFileObject_getflags_error002.phpt index e2c8255f44..00fd351db8 100644 --- a/ext/spl/tests/SplFileObject_getflags_error002.phpt +++ b/ext/spl/tests/SplFileObject_getflags_error002.phpt @@ -5,9 +5,9 @@ Erwin Poeze --FILE-- setFlags(SplFileObject::READ_CSV); $fo->getFlags('fake'); @@ -15,7 +15,7 @@ $fo->getFlags('fake'); ?> --CLEAN-- --EXPECTF-- Warning: SplFileObject::getFlags() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_rewind_error001.phpt b/ext/spl/tests/SplFileObject_rewind_error001.phpt index ac536a0a44..5f2379aa13 100644 --- a/ext/spl/tests/SplFileObject_rewind_error001.phpt +++ b/ext/spl/tests/SplFileObject_rewind_error001.phpt @@ -7,16 +7,16 @@ Erwin Poeze --FILE-- rewind( "invalid" ); ?> --CLEAN-- --EXPECTF-- Warning: SplFileObject::rewind() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/standard/tests/file/fgets_socket_variation1.phpt b/ext/standard/tests/file/fgets_socket_variation1.phpt index 57944d8b56..429ad67d69 100644 --- a/ext/standard/tests/file/fgets_socket_variation1.phpt +++ b/ext/standard/tests/file/fgets_socket_variation1.phpt @@ -5,11 +5,17 @@ Dave Kelsey --FILE-- --FILE-- --EXPECTF-- diff --git a/ext/standard/tests/network/tcp4loop.phpt b/ext/standard/tests/network/tcp4loop.phpt index afd955918e..a163cd9b35 100644 --- a/ext/standard/tests/network/tcp4loop.phpt +++ b/ext/standard/tests/network/tcp4loop.phpt @@ -2,14 +2,21 @@ Streams Based IPv4 TCP Loopback test --FILE-- --FILE-- --FILE-- string(17) "for all languages" } -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/zlib/tests/gzfile_basic2.phpt b/ext/zlib/tests/gzfile_basic2.phpt index 9f31eb0f87..2bbf315a1a 100644 --- a/ext/zlib/tests/gzfile_basic2.phpt +++ b/ext/zlib/tests/gzfile_basic2.phpt @@ -12,7 +12,7 @@ is a very common test for all languages EOT; $dirname = 'gzfile_temp'; -$filename = $dirname.'/plainfile.txt'; +$filename = $dirname.'/gzfile_basic2.txt'; mkdir($dirname); $h = fopen($filename, 'w'); fwrite($h, $plaintxt); @@ -36,4 +36,4 @@ array(3) { [2]=> string(17) "for all languages" } -===DONE=== \ No newline at end of file +===DONE=== diff --git a/ext/zlib/tests/gzopen_basic2.phpt b/ext/zlib/tests/gzopen_basic2.phpt index 5cc02cd182..90766b1817 100644 --- a/ext/zlib/tests/gzopen_basic2.phpt +++ b/ext/zlib/tests/gzopen_basic2.phpt @@ -18,7 +18,7 @@ echo "*** Testing gzopen() : basic functionality ***\n"; // Initialise all required variables -$filename = "temp.txt.gz"; +$filename = "gzopen_basic2.txt.gz"; $modes = array('w', 'w+'); $data = "This was the information that was written"; diff --git a/ext/zlib/tests/gzputs_basic.phpt b/ext/zlib/tests/gzputs_basic.phpt index 7566e74e72..6456e4b55f 100644 --- a/ext/zlib/tests/gzputs_basic.phpt +++ b/ext/zlib/tests/gzputs_basic.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- --FILE--