[PHP-CVS] cvs: phpruntests /src/taskScheduler rtTaskSchedulerFile.php

2009-07-08 Thread Georg Gradwohl
g2  Wed Jul  8 19:35:39 2009 UTC

  Modified files:  
/phpruntests/src/taskScheduler  rtTaskSchedulerFile.php 
  Log:
  phpruntests - minor bugfix taskScheduler
  
http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskSchedulerFile.php?r1=1.6r2=1.7diff_format=u
Index: phpruntests/src/taskScheduler/rtTaskSchedulerFile.php
diff -u phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.6 
phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.7
--- phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.6   Wed Jul  8 
19:23:23 2009
+++ phpruntests/src/taskScheduler/rtTaskSchedulerFile.php   Wed Jul  8 
19:35:39 2009
@@ -116,9 +116,10 @@


// register signal-handler
+   /*
pcntl_signal(SIGINT, rtTaskSchedulerFile::signalHandler);
pcntl_signal(SIGQUIT, rtTaskSchedulerFile::signalHandler);
-
+   */

// wait until all child-processes are terminated
for ($i=0; $i$this-processCount; $i++) {



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



[PHP-CVS] cvs: phpruntests /src/taskScheduler rtTaskSchedulerFile.php rtTaskTestGroup.php /src/testcase/output rtTestOutputWriterXML.php /src/testgroup rtPhpTestGroup.php

2009-06-29 Thread Georg Gradwohl
g2  Mon Jun 29 22:00:13 2009 UTC

  Modified files:  
/phpruntests/src/testcase/outputrtTestOutputWriterXML.php 
/phpruntests/src/testgroup  rtPhpTestGroup.php 
/phpruntests/src/taskScheduler  rtTaskSchedulerFile.php 
rtTaskTestGroup.php 
  Log:
  phpruntests - update taskScheduler - fixed out-of-memory-bug while running 
large tests
  
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterXML.php?r1=1.4r2=1.5diff_format=u
Index: phpruntests/src/testcase/output/rtTestOutputWriterXML.php
diff -u phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.4 
phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.5
--- phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.4   Mon Jun 
29 01:34:54 2009
+++ phpruntests/src/testcase/output/rtTestOutputWriterXML.php   Mon Jun 29 
22:00:12 2009
@@ -52,10 +52,8 @@
 
 
 /**
- *
- *
+*
  * @param array of rtTestResults
- *
  */
 public function init (array $testResults)
 {
@@ -103,5 +101,6 @@

return null;
 }
+
 }
-?
+?
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/phpruntests/src/testgroup/rtPhpTestGroup.php?r1=1.11r2=1.12diff_format=u
Index: phpruntests/src/testgroup/rtPhpTestGroup.php
diff -u phpruntests/src/testgroup/rtPhpTestGroup.php:1.11 
phpruntests/src/testgroup/rtPhpTestGroup.php:1.12
--- phpruntests/src/testgroup/rtPhpTestGroup.php:1.11   Mon Jun 29 01:34:54 2009
+++ phpruntests/src/testgroup/rtPhpTestGroup.phpMon Jun 29 22:00:13 2009
@@ -75,5 +75,12 @@
 $testOutputWriter = rtTestOutputWriter::getInstance($this-results, 
$outType);
 $testOutputWriter-write($this-testDirectory, $cid);
 }
+
+
+public function getResults()
+{
+   return $this-results;
+}
+
 }
 ?
http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskSchedulerFile.php?r1=1.3r2=1.4diff_format=u
Index: phpruntests/src/taskScheduler/rtTaskSchedulerFile.php
diff -u phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.3 
phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.4
--- phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.3   Mon Jun 29 
01:34:54 2009
+++ phpruntests/src/taskScheduler/rtTaskSchedulerFile.php   Mon Jun 29 
22:00:13 2009
@@ -17,11 +17,9 @@
 {
const TMP_FILE = 'taskFile';

-   private $inputQueue = NULL; // the input-queue (only used 
by the sender)
private $pidStore = array();// stores the pids of all 
child-processes
private $groupTasks = false;// are the tasks stored in groups?
-   
-   private $tmpTaskList = array();
+

/**
 * the constructor
@@ -59,8 +57,6 @@
$this-taskList = $taskList;
}
 
-   
-   
/**
 * sets the number of child-processes.
 * in the case of using a multidimensional task-list this parameter is
@@ -76,7 +72,6 @@
}
}
 
-

/**
 * starts the sender, the receiver and forks the defined
@@ -98,8 +93,8 @@
$this-processCount = sizeof($this-taskList);
}
 
+   // distribute the task to the children
$this-createTaskFiles();
-   
 
// fork the child-processes
for ($i=0; $i$this-processCount; $i++) {
@@ -126,7 +121,7 @@
pcntl_waitpid($this-pidStore[$i], $status);
}

-   // ensure that the tmp-files are completly written
+   // ensure that the tmp-files are completely written
sleep(1);

// collecting the results
@@ -137,8 +132,7 @@
 
return;
}
-   
-   
+

/**
 * creates a temporary file for each child which stores the allocated 
@@ -180,8 +174,9 @@
}
 

-   
/**
+* 
+* 
 * @return void
 */
private function receiver()
@@ -202,7 +197,7 @@
}
 
$index = $task-getIndex();
-   $task-finish($cid);
+   $task-evaluate($cid);

if ($this-groupTasks == true) { 

@@ -219,10 +214,12 @@

return; 
}
-   
 

/**
+* executes the assigned tasks and stores the serialized task-object in
+* the task-file. 
+* 
 * @param  int  $cidthe child-id
 * @return void
 */
@@ -231,24 +228,26 @@
$indexList = file_get_contents(self::TMP_FILE.$cid);
$indexList = explode(';', $indexList);