If I use the following code, everything looks fine: {noformat} {{job id="test" start="{{velocity~}~}$! \ {request.confirm}{{/velocity~}~}"}} {{groovy}} import org.xwiki.logging.LogLevel; def log = services.logging.getLogger(doc.fullName) services.logging.setLevel(doc.fullName, LogLevel.INFO); services.progress.pushLevel(5); for (int i = 0; i < 5; i++) { services.progress.startStep(); log.info('Step {}', i); sleep(1000); services.progress.endStep(); } services.progress.popLevel(); {{/groovy}} {{/job}} {noformat} I get the following logs: {noformat} Starting job of type [macrojob] with identifier [test] Step 0 Step 1 Step 2 Step 3 Step 4 Finished job of type [macrojob] with identifier [test] {noformat} However, if I comment out the "sleep(1000)" line, I get a warning between "Step 4" and "Finished job [...]": {noformat} Impossible to pop namespace [xwiki:Test] because current namespace is [DefaultIconRenderer] {noformat} The text after "current namespace is" varies between runs (xwiki:Test being the name of the page I'm writing my code in).
I don't expect the the execution time of the steps to change anything. This looks like a race condition. |
|