Release Automation

 View Only

approaches for checking cmd outputs, if the end result list might not be complete after first call

  • 1.  approaches for checking cmd outputs, if the end result list might not be complete after first call

    Posted Mar 21, 2017 06:19 AM

    Hey everyone,

     

    first of all, sorry for this veeeeeeeeeery long title, but I didn't know a better, shorter way to explain the purpose of this discussion

     

    we have the following situation, during a deployment we start a windows service, that for himself has a loading sequence as well. the status of the load can be checked with a special status call.

     

    BUT the status only returns a list of the elements that have already been loaded and not e.g. something like "12 of 50 loaded". So, now comes the fun part

     

    I would like to know how you approach such scenarios, we currently have the following ideas:

     

    1) delay in front of the status check

    this is probably the most unstable one, as the delay would be fix, but what happens if there is one time, when it does take longer than the delay?

     

    2) define a special element that gets loaded last

    the project suggested to define a certain element that then should be loaded as the last one. so the status call would be in a while loop and I would exit the loop as soon as I find the defined element in the result list. sounds ok to me, but I fear that we still miss out on something. the other thing I don't like about this approach is, that we add something to the system, that doesn't do anything other then being a placeholder for the status check.

     

    3) check the number of results and see if it changes over a couple of tries

    for this approach I thought of building a while loop with a short delay and then I keep checking the number of results the status code returns and if the number doesn't change over a defined number of tries, I would assume that every element is loaded.

     

    maybe the sweet spot is somewhere between 2 and 3.

     

    but, as I posted this as a discussion, I would like to hear your stories or did you never run into such a scenario?

     

    best regards

    Michael