copy paste - Ant build shutdown - Ctrl C -


i have set of ant tasks use run test suite, 1 of tests freeze , entire test suite hang. added shutdown handler when hit ctrl-c ant shutdown gracefully , give me report final test marked not run. (this important because these integration tests , can run hours) works great except on windows shutdown hook not being called. there way can ant respond kind of input , graceful shutdown?

it seems long-running known issue.

the problem on windows ant ctrl-c is, have observed, not propagated child vms. things might consider:

  • break test smaller pieces , use timeout kill hangs. limit data lost 1 test hangs.
  • in test run, add 'listener' thread waits shutdown 'signal' (perhaps presence of flag file) , arrange signal set ant, on command console, if hang detected.

this appears complex, might worth shot. you'd need combine ant parallel , input tasks run tests in 1 thread, , wait input console in second thread. when abort chosen, signal file written, detected in test run 'listener', causing terminate. other input lead clean termination of run. problem that, if test completes successfully, you're left ant waiting user input, put overall timeout in place that. (i've not given example of how test run code might detect signal file.)

psuedo-ant:

<property name="signal.abort" value="stop.txt" /> <target name="runner">     <delete file="${signal.abort}" />     <parallel timeout="86400000">         <sequential>              <!-- run tests here -->          </sequential>         <sequential>             <input validargs="y,n"                    message="abort test (y/n)?"                    addproperty="abort.test" />             <condition property="do.abort">                 <equals arg1="y" arg2="${abort.test}"/>             </condition>             <ant target="terminator" />         </sequential>     </parallel> </target>  <target name="terminator" if="do.abort">     <echo message="abort" file="${signal.abort}" /> </target> 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -