Thanks for your quick response Ullrich. Unfortunately, I tried it before sending my message to the list and it didn't work. Sample code snippet - Groovy Postbuild:
<CODE>
int i=0
while (true) {
if (++i > 20) { //to do not create a zombie build :)
manager.listener.logger.println "Timeout. Aborting..."
break
}
if (Thread.currentThread().isInterrupted()) {
manager.listener.logger.println "Interrupted. Aborting..."
break
}
manager.listener.logger.println "Not aborted - ${manager.getResult()} - ${Thread.currentThread().isInterrupted()}"
sleep(1000)
}
</CODE>
As a result I have:
<OUTPUT>
Not aborted - SUCCESS - false
Not aborted - SUCCESS - false
(...)
Not aborted - SUCCESS - false
Timeout. Aborting...
</OUTPUT>
I tested it also with the Groovy system script and the result is the same. I'm unable to detect if an abort was requested. It's somehow a limitation if you wait for some external event in the Groovy script.
Is it the same thread? Is there any other way to check if an abort was requested?
Marcin