[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-qa
Subject:    [PHP-QA] com pftt2: configuration updates: =?UTF-8?Q?conf/internal=5Fexample/Commo?= =?UTF-8?Q?nConf
From:       Matt Ficken <mattficken () php ! net>
Date:       2013-10-11 19:01:21
Message-ID: php-mail-6bd1adca4ddeb83f6fd1acdbc45fdc4a170081790 () git ! php ! net
[Download RAW message or body]

Commit:    889874a5782713f5f488b83a1c2e1092e1defdd1
Author:    Matt Ficken <v-mafick@microsoft.com>         Fri, 11 Oct 2013 12:01:21 -0700
Parents:   5d116c51304262c11cc9e32941c661506c4835a3
Branches:  master

Link:       http://git.php.net/?p=pftt2.git;a=commitdiff;h=889874a5782713f5f488b83a1c2e1092e1defdd1

Log:
configuration updates

Changed paths:
  M  conf/internal_example/CommonConfig.groovy
  M  conf/local_mysql.groovy
  M  conf/task/list_builtin_functions.groovy
  M  conf/task/low_stress.groovy
  M  conf/task/process_churn.groovy
  M  conf/task/release_test_full.groovy
  M  conf/task/snap_test.groovy
  M  src/com/mostc/pftt/util/TimerUtil.java
  M  src/com/mostc/pftt/util/apache/regexp/REDebugCompiler.java


["diff_889874a5782713f5f488b83a1c2e1092e1defdd1.txt" (text/plain)]

diff --git a/conf/internal_example/CommonConfig.groovy \
b/conf/internal_example/CommonConfig.groovy index ec266d6..e956d57 100644
--- a/conf/internal_example/CommonConfig.groovy
+++ b/conf/internal_example/CommonConfig.groovy
@@ -1,7 +1,7 @@
 import com.mostc.pftt.host.*;
 
 static def getFileServerHost() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		// home network
@@ -12,7 +12,7 @@ static def getFileServerHost() {
 }
 
 static def getFileServerVolume() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		return "B:";
@@ -22,7 +22,7 @@ static def getFileServerVolume() {
 
 // database
 static def getDatabaseServerHost() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		// home network
@@ -34,7 +34,7 @@ static def getDatabaseServerHost() {
 
 // ftp
 static def getFTPServerHost() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		// home network
@@ -46,7 +46,7 @@ static def getFTPServerHost() {
 
 // http
 static def getHTTPServerHost() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		// home network
@@ -58,7 +58,7 @@ static def getHTTPServerHost() {
 
 // soap
 static def getSOAPServerHost() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		// home network
@@ -70,7 +70,7 @@ static def getSOAPServerHost() {
 
 // xmlrpc
 static def getXMLRPCServerHost() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		// home network
@@ -82,7 +82,7 @@ static def getXMLRPCServerHost() {
 
 // imap (email)
 static def getIMAPServerHost() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		// home network
@@ -94,7 +94,7 @@ static def getIMAPServerHost() {
 
 // ldap (directory)
 static def getLDAPServerHost() {
-	String addr = new LocalHost().getAddress()
+	String addr = LocalHost.getInstance().getAddress()
 	// autodetect which network this is running on
 	if (addr.startsWith("192."))
 		// home network
diff --git a/conf/local_mysql.groovy b/conf/local_mysql.groovy
index 0cd2e58..07994a9 100644
--- a/conf/local_mysql.groovy
+++ b/conf/local_mysql.groovy
@@ -5,7 +5,7 @@ def describe() {
 }
 
 def scenarios() {
-	new MySQLScenario(new LocalHost());
+	new MySQLScenario(LocalHost.getInstance());
 }
 
 import com.mostc.pftt.model.core.PhpBuild;
@@ -17,8 +17,7 @@ import com.mostc.pftt.model.core.PhptSourceTestPack;
 //    should use $_ENV instead: modify `mysql` PHPTs to use $_ENV instead.
 //
 def processPHPTTestPack(PhptSourceTestPack test_pack, PhpResultPackWriter writer, \
                PhpBuild build) {
-	LocalHost host = new LocalHost();
-	String php_code = host.readFileAsString(test_pack.getSourceDirectory()+"/ext/pdo/tests/pdo_test.inc");
 +	String php_code = \
LocalHost.getInstance().readFileAsString(test_pack.getSourceDirectory()+"/ext/pdo/tests/pdo_test.inc");
  
 	if (php_code.contains("function getenv")) {
 		// already modified
@@ -40,6 +39,6 @@ $php_code
 		php_file = test_pack.getSourceDirectory()+"/ext/pdo/tests/pdo_test.inc";
 	
 		System.out.println("local_mysql: modifying $php_file for MySQL scenario");
-		host.saveTextFile(php_file, php_code);
+		LocalHost.getInstance().saveTextFile(php_file, php_code);
 	}
 }
diff --git a/conf/task/list_builtin_functions.groovy \
b/conf/task/list_builtin_functions.groovy index aca0ffb..d515f32 100644
--- a/conf/task/list_builtin_functions.groovy
+++ b/conf/task/list_builtin_functions.groovy
@@ -29,7 +29,7 @@ def processConsoleOptions(List options) {
 	// threads take more CPU time to do the analysis, etc...
 	// so run fewer threads
 	options.add("-thread_count");
-	options.add(""+( 1 * new LocalHost().getCPUCount()));
+	options.add(""+( 1 * LocalHost.getInstance().getCPUCount()));
 }
 
 def processUITestResult() {
diff --git a/conf/task/low_stress.groovy b/conf/task/low_stress.groovy
index 9eb484b..ce9d7ee 100644
--- a/conf/task/low_stress.groovy
+++ b/conf/task/low_stress.groovy
@@ -5,5 +5,5 @@ def describe() {
 
 def processConsoleOptions(List options) {
 	options.add("-thread_count");
-	options.add(""+( 1 * new LocalHost().getCPUCount()));
+	options.add(""+( 1 * LocalHost.getInstance().getCPUCount()));
 }
\ No newline at end of file
diff --git a/conf/task/process_churn.groovy b/conf/task/process_churn.groovy
index 5d258a9..fe36084 100644
--- a/conf/task/process_churn.groovy
+++ b/conf/task/process_churn.groovy
@@ -5,5 +5,5 @@ def describe() {
 
 def processConsoleOptions(List options) {
 	options.add("-thread_count");
-	options.add(""+( 24 * new LocalHost().getCPUCount()));
+	options.add(""+( 24 * LocalHost.getInstance().getCPUCount()));
 }
diff --git a/conf/task/release_test_full.groovy b/conf/task/release_test_full.groovy
index 0fba95f..419712d 100644
--- a/conf/task/release_test_full.groovy
+++ b/conf/task/release_test_full.groovy
@@ -9,7 +9,7 @@ def processConsoleOptions(List options) {
 	// (basically snap_test * 4 file-system scenarios)
 	options.add("smb,dfs,deduplication,localfs,not_remote_fs_builtin_web")
 	options.add("-c")
-	options.add("snap_test")
+	options.add("snap_test,wincacheu_only_user,wincacheu_only_file")
 	
 	// TODO iis wincacheu apcu mediawiki drupal joomla typo3 cake_php zend \
semantic_mediawiki  }
diff --git a/conf/task/snap_test.groovy b/conf/task/snap_test.groovy
index 884fc79..06e5468 100644
--- a/conf/task/snap_test.groovy
+++ b/conf/task/snap_test.groovy
@@ -12,12 +12,12 @@ def processConsoleOptions(List options) {
 	options.add("-c")
 	// test with and without opcache 
 	options.add("opcache,no_code_cache,not_opcache_builtin_web")
-	//options.add("-c")
+	options.add("-c")
 	// test with WinCacheU:
 	//   users probably won't run wincacheu_only_file in production (skip)
 	//   users probably won't run wincacheu* with no_code_cache (skip)
 	//   no_user_cache => test without wincacheu, enables scenariosets that wincacheu \
                doesn't support
-	//options.add("no_user_cache,not_wincacheu_no_code_cache,wincacheu_only_user,not_wincacheu_builtin_web,wincacheu_file_and_user")
 +	options.add("no_user_cache,not_wincacheu_no_code_cache,not_wincacheu_builtin_web,wincacheu_file_and_user")
  options.add("-c")
 	// test with these Applications (to make sure new PHP build doesn't break them)
 	options.add("joomla,symfony,wordpress")
@@ -30,6 +30,6 @@ def processConsoleOptions(List options) {
 	options.add("-max_run_time_millis")
 	options.add(""+(1*60*60*1000))
 	
-	// TODO apcu mssql postgresql sqlite3 ftp xmlrpc soap
+	// TODO apcu postgresql sqlite3 ftp xmlrpc soap
 	// TODO mediawiki drupal typo3 cake_php zend semantic_mediawiki tiki fengoffice \
phpbb squirelmail  }
diff --git a/src/com/mostc/pftt/util/TimerUtil.java \
b/src/com/mostc/pftt/util/TimerUtil.java index cfe073b..1c92452 100644
--- a/src/com/mostc/pftt/util/TimerUtil.java
+++ b/src/com/mostc/pftt/util/TimerUtil.java
@@ -2,6 +2,7 @@ package com.mostc.pftt.util;
 
 import java.lang.Thread.UncaughtExceptionHandler;
 import java.util.LinkedList;
+import java.util.NoSuchElementException;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import com.mostc.pftt.host.LocalHost;
@@ -11,7 +12,7 @@ public final class TimerUtil {
 	 
 	private static LinkedList<ThreadRunnableProxy> trp_pool = new \
LinkedList<ThreadRunnableProxy>();  static {
-		final int pool_size = Math.max(128, new LocalHost().getCPUCount() * 16);
+		final int pool_size = Math.max(128, LocalHost.getInstance().getCPUCount() * 16);
 		for ( int i = 0 ; i < pool_size ; i++ ) {
 			ThreadRunnableProxy trp = new ThreadRunnableProxy();
 			new Thread(trp).start();
@@ -82,10 +83,12 @@ public final class TimerUtil {
 	 */
 	public static Thread runThread(Runnable r) {
 		ThreadRunnableProxy trp = null;
-		synchronized(trp_pool) {
-			if (!trp_pool.isEmpty())
-				trp = trp_pool.removeLast();
-		}
+		try {
+			synchronized(trp_pool) {
+				if (!trp_pool.isEmpty())
+					trp = trp_pool.removeLast();
+			}
+		} catch ( NoSuchElementException e ) {}
 		if (trp==null) {
 			return new Thread(r);
 		} else {
@@ -112,10 +115,14 @@ public final class TimerUtil {
 	
 	public static <E extends Object> WaitableRunnable<E> runWaitSeconds(String \
name_prefix, int seconds, ObjectRunnable<E> or) {  WaitableRunnable<E> wr = new \
                WaitableRunnable<E>(or);
-		Thread t = runThread(name_prefix, wr);
-		t.setUncaughtExceptionHandler(IGNORE);
-		wr.t = t;
-		wr.block(seconds);
+		try {
+			Thread t = runThread(name_prefix, wr);
+			t.setUncaughtExceptionHandler(IGNORE);
+			wr.t = t;
+			wr.block(seconds);
+		} catch ( Throwable t ) {
+			t.printStackTrace();
+		}
 		return wr;
 	}
 	
diff --git a/src/com/mostc/pftt/util/apache/regexp/REDebugCompiler.java \
b/src/com/mostc/pftt/util/apache/regexp/REDebugCompiler.java index e1acccc..6d7c954 \
                100644
--- a/src/com/mostc/pftt/util/apache/regexp/REDebugCompiler.java
+++ b/src/com/mostc/pftt/util/apache/regexp/REDebugCompiler.java
@@ -27,7 +27,7 @@ import java.util.Hashtable;
  * @author <a href="mailto:jonl@muppetlabs.com">Jonathan Locke</a>
  * @version $Id: REDebugCompiler.java 518169 2007-03-14 15:03:35Z vgritsenko $
  */
-public class REDebugCompiler extends RECompiler
+public class REDebugCompiler extends RECompiler 
 {
     /**
      * Mapping from opcodes to descriptive strings



-- 
PHP Quality Assurance Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic