harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r597326 - in /harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot: adaptor.xml parameters.xml suite-cc-custom-config.xml
Date Thu, 22 Nov 2007 08:00:40 GMT
Author: smishura
Date: Thu Nov 22 00:00:39 2007
New Revision: 597326

URL: http://svn.apache.org/viewvc?rev=597326&view=rev
Log:
Automate processes cleaning after a suite run (Linux only).

A suite run may leave hung VM processes that in turn may affect
the next running suite or even make CruiseControl down.
I believe that this feature should be part of the infra's common cycle
(not specific for snapshots only) so I'm going to move it there
after some infra redesigning.

Modified:
    harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/adaptor.xml
    harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/parameters.xml
    harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/suite-cc-custom-config.xml

Modified: harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/adaptor.xml?rev=597326&r1=597325&r2=597326&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/adaptor.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/adaptor.xml Thu Nov 22 00:00:39
2007
@@ -512,5 +512,50 @@
             </condition>
         </sequential>
     </macrodef>
+
+    <!--                                                     -->
+    <!-- clear orphan processes left by suite run            -->
+    <!-- the feature is optional (use 'do.processes.cleanup' -->
+    <!-- TODO: make the feature part of common cycle         -->
+    <!-- (not ony for snapshots)                             -->
+    <target name="clear-processes"
+            if="need.processes.cleanup"
+            depends="-init-clear-processes">
+
+        <echo>PROCESSES: ${proccess}</echo>
+        <exec executable="kill">
+            <arg value="proccess" />
+        </exec>
+    </target>
+
+    <target name="-init-clear-processes" unless="is.windows">
+        <exec executable="ps">
+            <arg value="a" />
+            <redirector outputproperty="proccess">
+                <outputfilterchain>
+                    <!-- select only snapshot vm -->
+                    <linecontains>
+                        <contains value="${jvm.location}" />
+                    </linecontains>
+                    <!-- get processes pids -->
+                    <tokenfilter>
+                        <replaceregex pattern="^\s*(\d+).*" replace="\1 " />
+                    </tokenfilter>
+                    <striplinebreaks />
+                </outputfilterchain>
+            </redirector>
+        </exec>
+
+        <condition property="need.processes.cleanup">
+            <and>
+                <istrue value="${do.processes.cleanup}" />
+                <length string="${proccess}"
+                        trim="true"
+                        when="greater"
+                        length="0" />
+            </and>
+        </condition>
+    </target>
+
 </project>
 

Modified: harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/parameters.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/parameters.xml?rev=597326&r1=597325&r2=597326&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/parameters.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/parameters.xml Thu Nov 22 00:00:39
2007
@@ -8,6 +8,10 @@
         <hdk value="${checkouts.dir}/snapshot/hdk"/>
         <jvm.location value="${checkouts.dir}/snapshot/hdk/jdk/jre/bin/java${exe}"/>
         <svn.revision.file location="${checkouts.dir}/snapshot/svn.revision"/>
+
+        <do.processes.cleanup
+            description="Whether to kill orphan processes(Linux only)"
+            value="false"/>
     </shared>
 
     <mail summary="${svn.revision.file}"/>

Modified: harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/suite-cc-custom-config.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/suite-cc-custom-config.xml?rev=597326&r1=597325&r2=597326&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/suite-cc-custom-config.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/adaptors/snapshot/suite-cc-custom-config.xml Thu
Nov 22 00:00:39 2007
@@ -68,6 +68,14 @@
                 <property name='snapshot.arch.dir' value='${snapshot.arch.dir}'/>
                 <property name='cc.execution.log.file' value='${cc.execution.log.file}'/>
             </antpublisher>
+            <antpublisher
+                 anthome='${ant.home}'
+                 antWorkingDir='${root.dir}'
+                 buildfile='${adaptors.dir}/snapshot/adaptor.xml'
+                 target='clear-processes'>
+                <property name='jvm.location' value='${snapshot.jvm.location}'/>
+                <property name='do.processes.cleanup' value='${snapshot.do.processes.cleanup}'/>
+            </antpublisher>
         </publishers>
 
     </project>



Mime
View raw message