ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1027125 - in /ant/core/trunk: WHATSNEW docs/manual/Tasks/parallel.html src/main/org/apache/tools/ant/taskdefs/Parallel.java src/tests/antunit/taskdefs/parallel-test.xml
Date Mon, 25 Oct 2010 14:04:39 GMT
Author: bodewig
Date: Mon Oct 25 14:04:38 2010
New Revision: 1027125

URL: http://svn.apache.org/viewvc?rev=1027125&view=rev
Log:
don't allow tasks to finish in <parallel> when the manual says 'execution is terminated'.
 PR 49527

Added:
    ant/core/trunk/src/tests/antunit/taskdefs/parallel-test.xml   (with props)
Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/docs/manual/Tasks/parallel.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1027125&r1=1027124&r2=1027125&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Oct 25 14:04:38 2010
@@ -173,6 +173,10 @@ Fixed bugs:
    links from a properties file.
    Bugzilla Report 50136.
 
+ * <parallel> could allow tasks to start executing even if a task
+   scheduled to run before them timed out.
+   Bugzilla Report 49527
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/docs/manual/Tasks/parallel.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/Tasks/parallel.html?rev=1027125&r1=1027124&r2=1027125&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/Tasks/parallel.html (original)
+++ ant/core/trunk/docs/manual/Tasks/parallel.html Mon Oct 25 14:04:38 2010
@@ -79,7 +79,7 @@
     <td valign="top">failonany</td>
     <td valign="top">If any of the nested tasks fails, execution of the task completes
                      at that point without waiting for any other tasks to complete.</td>
-    <td align="center" valign="top">No</td>
+    <td align="center" valign="top">No, default is false.</td>
   </tr>
   <tr>
     <td valign="top">pollInterval</td>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java?rev=1027125&r1=1027124&r2=1027125&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java Mon Oct 25 14:04:38
2010
@@ -350,7 +350,10 @@ public class Parallel extends Task
                 interrupted = true;
             }
 
-            killAll(running);
+            if (!timedOut && !failOnAny) {
+                // https://issues.apache.org/bugzilla/show_bug.cgi?id=49527
+                killAll(running);
+            }
         }
 
         if (interrupted) {

Added: ant/core/trunk/src/tests/antunit/taskdefs/parallel-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/parallel-test.xml?rev=1027125&view=auto
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/parallel-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/parallel-test.xml Mon Oct 25 14:04:38 2010
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<project default="antunit"
+         xmlns:au="antlib:org.apache.ant.antunit">
+
+  <import file="../antunit-base.xml" />
+
+  <target name="testTimeout"
+          description="https://issues.apache.org/bugzilla/show_bug.cgi?id=49527">
+    <au:expectfailure message="Parallel execution timed out">
+      <parallel timeout="2000">
+        <sequential>
+          <echo message="Before sleep" />
+          <sleep seconds="10" />
+          <echo message="After sleep" />
+        </sequential>
+      </parallel>
+    </au:expectfailure>
+    <au:assertLogDoesntContain text="After sleep"/>
+  </target>
+</project>
\ No newline at end of file

Propchange: ant/core/trunk/src/tests/antunit/taskdefs/parallel-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message