OK, I found testRunner.status which has a value of 'CANCELED' after canceling the test case:
def timeout = 10000
def elapsedTime = 0
def increment = 1000
while (testRunner.status.toString() != 'CANCELED' && elapsedTime < timeout ) {
sleep(increment)
elapsedTime += increment
log.info "Elapsed time = $elapsedTime and TestRunner status = $testRunner.status"
}
log.info "All done"
Log:
Mon Mar 15 11:14:55 EDT 2010:INFO:Elapsed time = 1000 and TestRunner status = RUNNING
Mon Mar 15 11:14:56 EDT 2010:INFO:Elapsed time = 2000 and TestRunner status = RUNNING
Mon Mar 15 11:14:57 EDT 2010:INFO:Elapsed time = 3000 and TestRunner status = RUNNING
Mon Mar 15 11:14:58 EDT 2010:INFO:Elapsed time = 4000 and TestRunner status = CANCELED
Mon Mar 15 11:14:58 EDT 2010:INFO:All done