dmitry                                   Tue, 22 Sep 2009 14:52:47 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=288578

Log:
Fixed tests which fail from time to time because of race conditions ("echo" 
command didn't wait for all the data php tried to send and as result php got a 
SIGPIPE)

Changed paths:
    U   php/php-src/branches/PHP_5_2/ext/standard/tests/mail/mail_basic2.phpt
    U   
php/php-src/branches/PHP_5_2/ext/standard/tests/mail/mail_variation2.phpt
    U   php/php-src/branches/PHP_5_3/ext/standard/tests/mail/mail_basic2.phpt
    U   
php/php-src/branches/PHP_5_3/ext/standard/tests/mail/mail_variation2.phpt
    U   php/php-src/trunk/ext/standard/tests/mail/mail_basic2.phpt
    U   php/php-src/trunk/ext/standard/tests/mail/mail_variation2.phpt

Modified: php/php-src/branches/PHP_5_2/ext/standard/tests/mail/mail_basic2.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/mail/mail_basic2.phpt       
2009-09-22 14:52:32 UTC (rev 288577)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/mail/mail_basic2.phpt       
2009-09-22 14:52:47 UTC (rev 288578)
@@ -6,7 +6,7 @@
   die("skip Won't run on Windows");
 ?>
 --INI--
-sendmail_path="echo --- > /tmp/php_test_mailBasic2.out"
+sendmail_path="sed > /tmp/php_test_mailBasic2.out"
 --FILE--
 <?php
 /* Prototype  : int mail(string to, string subject, string message [, string 
additional_headers [, string additional_parameters]])
@@ -23,7 +23,7 @@
 $subject = 'Test Subject';
 $message = 'A Message';
 $additional_headers = 'KHeaders';
-$additional_parameters = "Extras";
+$additional_parameters = "-e '5 a--- Extras'";
 $outFile = "/tmp/php_test_mailBasic2.out";
 @unlink($outFile);

@@ -31,11 +31,6 @@
 // Calling mail() with all possible arguments
 var_dump( mail($to, $subject, $message, $additional_headers, 
$additional_parameters) );

-//This test is just using a shell command (see the INI setting). The sleep()
-//is used because that can take a while. If you see the test failing sometimes 
try
-//increasing the length of the sleep.
-
-sleep(5);
 echo file_get_contents($outFile);
 unlink($outFile);
 ?>
@@ -44,5 +39,10 @@
 *** Testing mail() : basic functionality ***
 -- extra parameters --
 bool(true)
+To: u...@company.com
+Subject: Test Subject
+KHeaders
+
+A Message
 --- Extras
 ===DONE===

Modified: 
php/php-src/branches/PHP_5_2/ext/standard/tests/mail/mail_variation2.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/tests/mail/mail_variation2.phpt   
2009-09-22 14:52:32 UTC (rev 288577)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/mail/mail_variation2.phpt   
2009-09-22 14:52:47 UTC (rev 288578)
@@ -1,8 +1,8 @@
 --TEST--
 Test mail() function : variation force extra parameters
 --INI--
-sendmail_path="echo --- > /tmp/php_test_mailVariation2.out"
-mail.force_extra_parameters="forced params"
+sendmail_path="sed > /tmp/php_test_mailVariation2.out"
+mail.force_extra_parameters="-e4a---forced-params"
 --SKIPIF--
 <?php
 if(substr(PHP_OS, 0, 3) == "WIN")
@@ -35,5 +35,9 @@
 --EXPECT--
 *** Testing mail() : basic functionality ***
 bool(true)
---- forced params
+To: u...@company.com
+Subject: Test Subject
+
+A Message
+---forced-params
 ===DONE===

Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/mail/mail_basic2.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/mail/mail_basic2.phpt       
2009-09-22 14:52:32 UTC (rev 288577)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/mail/mail_basic2.phpt       
2009-09-22 14:52:47 UTC (rev 288578)
@@ -6,7 +6,7 @@
   die("skip Won't run on Windows");
 ?>
 --INI--
-sendmail_path="echo --- > /tmp/php_test_mailBasic2.out"
+sendmail_path="sed > /tmp/php_test_mailBasic2.out"
 --FILE--
 <?php
 /* Prototype  : int mail(string to, string subject, string message [, string 
additional_headers [, string additional_parameters]])
@@ -23,7 +23,7 @@
 $subject = 'Test Subject';
 $message = 'A Message';
 $additional_headers = 'KHeaders';
-$additional_parameters = "Extras";
+$additional_parameters = "-e '5 a--- Extras'";
 $outFile = "/tmp/php_test_mailBasic2.out";
 @unlink($outFile);

@@ -31,11 +31,6 @@
 // Calling mail() with all possible arguments
 var_dump( mail($to, $subject, $message, $additional_headers, 
$additional_parameters) );

-//This test is just using a shell command (see the INI setting). The sleep()
-//is used because that can take a while. If you see the test failing sometimes 
try
-//increasing the length of the sleep.
-
-sleep(5);
 echo file_get_contents($outFile);
 unlink($outFile);
 ?>
@@ -44,5 +39,10 @@
 *** Testing mail() : basic functionality ***
 -- extra parameters --
 bool(true)
+To: u...@company.com
+Subject: Test Subject
+KHeaders
+
+A Message
 --- Extras
 ===DONE===

Modified: 
php/php-src/branches/PHP_5_3/ext/standard/tests/mail/mail_variation2.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/tests/mail/mail_variation2.phpt   
2009-09-22 14:52:32 UTC (rev 288577)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/mail/mail_variation2.phpt   
2009-09-22 14:52:47 UTC (rev 288578)
@@ -1,8 +1,8 @@
 --TEST--
 Test mail() function : variation force extra parameters
 --INI--
-sendmail_path="echo --- > /tmp/php_test_mailVariation2.out"
-mail.force_extra_parameters="forced params"
+sendmail_path="sed > /tmp/php_test_mailVariation2.out"
+mail.force_extra_parameters="-e4a---forced-params"
 --SKIPIF--
 <?php
 if(substr(PHP_OS, 0, 3) == "WIN")
@@ -35,5 +35,9 @@
 --EXPECT--
 *** Testing mail() : basic functionality ***
 bool(true)
---- forced params
+To: u...@company.com
+Subject: Test Subject
+
+A Message
+---forced-params
 ===DONE===

Modified: php/php-src/trunk/ext/standard/tests/mail/mail_basic2.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/mail/mail_basic2.phpt  2009-09-22 
14:52:32 UTC (rev 288577)
+++ php/php-src/trunk/ext/standard/tests/mail/mail_basic2.phpt  2009-09-22 
14:52:47 UTC (rev 288578)
@@ -6,7 +6,7 @@
   die("skip Won't run on Windows");
 ?>
 --INI--
-sendmail_path="echo --- > /tmp/php_test_mailBasic2.out"
+sendmail_path="sed > /tmp/php_test_mailBasic2.out"
 --FILE--
 <?php
 /* Prototype  : int mail(string to, string subject, string message [, string 
additional_headers [, string additional_parameters]])
@@ -23,7 +23,7 @@
 $subject = 'Test Subject';
 $message = 'A Message';
 $additional_headers = 'KHeaders';
-$additional_parameters = "Extras";
+$additional_parameters = "-e '5 a--- Extras'";
 $outFile = "/tmp/php_test_mailBasic2.out";
 @unlink($outFile);

@@ -31,11 +31,6 @@
 // Calling mail() with all possible arguments
 var_dump( mail($to, $subject, $message, $additional_headers, 
$additional_parameters) );

-//This test is just using a shell command (see the INI setting). The sleep()
-//is used because that can take a while. If you see the test failing sometimes 
try
-//increasing the length of the sleep.
-
-sleep(5);
 echo file_get_contents($outFile);
 unlink($outFile);
 ?>
@@ -44,5 +39,10 @@
 *** Testing mail() : basic functionality ***
 -- extra parameters --
 bool(true)
+To: u...@company.com
+Subject: Test Subject
+KHeaders
+
+A Message
 --- Extras
 ===DONE===

Modified: php/php-src/trunk/ext/standard/tests/mail/mail_variation2.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/mail/mail_variation2.phpt      
2009-09-22 14:52:32 UTC (rev 288577)
+++ php/php-src/trunk/ext/standard/tests/mail/mail_variation2.phpt      
2009-09-22 14:52:47 UTC (rev 288578)
@@ -1,8 +1,8 @@
 --TEST--
 Test mail() function : variation force extra parameters
 --INI--
-sendmail_path="echo --- > /tmp/php_test_mailVariation2.out"
-mail.force_extra_parameters="forced params"
+sendmail_path="sed > /tmp/php_test_mailVariation2.out"
+mail.force_extra_parameters="-e4a---forced-params"
 --SKIPIF--
 <?php
 if(substr(PHP_OS, 0, 3) == "WIN")
@@ -35,5 +35,9 @@
 --EXPECT--
 *** Testing mail() : basic functionality ***
 bool(true)
---- forced params
+To: u...@company.com
+Subject: Test Subject
+
+A Message
+---forced-params
 ===DONE===

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to