Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Script dows not work since QuickBuild 15 #4616

MFalkner ·

I've found kind of a strange thing: I tried to detect if any of the steps have timed out.
For this, I use the following groovy script:

groovy:
boolean isAnyChildTimedout = false;
logger.info("step = " + step.getPath().toString())
if (step.parent != null) {
  logger.info("parent = " + step.parent.getPath().toString())
  for (child in step.parent.children) {
    logger.info("child = " + child.getPath().toString())
    logger.info("timeout = " + child.timeout.toString())
    if (child.timeout && !child.getPath().equals(step.getPath())) {
      logger.info("timeout found!")
      isAnyChildTimedout = true;
      break;
    }
  }
}
return !isAnyChildTimedout

This worked fine till I updated to version 15.
I added the logs as shown above in the script, and I'm not able to find the problem:

20:53:43,645 INFO  - Checking step execute condition...
20:53:43,884 INFO  - step = master>Platform Test>Tests Run?TestName=GetLogs
20:53:43,894 INFO  - parent = master>Platform Test
20:53:43,894 INFO  - child = master>Platform Test>Copy Build
20:53:43,894 INFO  - timeout = 0
20:53:43,894 INFO  - timeout found!
20:53:43,895 INFO  - Step execute condition not satisfied, step will be skipped.

child.timeout is 0, therefore I it should not enter the "if" case, but it seems to do so.

Regards, Martin

  • solved #2
  • replies 3
  • views 16
  • stars 0
robinshen ADMIN ·

QB15 makes major update for groovy lib (as well as many other important libs). And some behavior may get changed. For this issue, step.timeout actually returns a string (this is the same in QB14 and QB15), so step.timeout != "0" needs to be used here. Seems that old groovy version simply takes it as a number in a boolean expression, which might be inappopriate.

MFalkner ·

Many thanks, I used child.timeout.toBoolean() now, it works again.
But now I'm confused about the meaning of timeout, is it the timeout specified for the step (and therefore string/number) or a flag, whether the step had a timeout?

robinshen ADMIN ·

This is actually a setting telling QB maximum allowed execution time of the step. To check if a step is timed out actually, use step.isTimeout() instead. I admit that there are confusions here, as the step has getTimeout() and isTimeout() for different purposes...