Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-13411

Bunch of flaky tests around having the wrong assumption about a program in RUNNING state means

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0
    • Component/s: None
    • Labels:
      None
    • Release Notes:
      Improved robustness of unit test framework by fixing flaky tests
    • Rank:
      1|i00clz:

      Description

      It is particularly a problem for Service and Worker.

      E.g. in this build https://builds.cask.co/browse/CDAP-DUT6370-51/test

      1. It starts a Worker and wait for it to be in RUNNING state
      2. It then starts a Service and wait for it to be in RUNNING state
      3. It makes a call to the Service to read a value from a table, which the value was written by the Worker

      However, there is no guarantee that when the Worker is in RUNNING state, it already performed it's task, hence occasionally resulting in NPE in the service handler.

       

      Another example is in https://builds.cask.co/browse/CDAP-DUT6370-52

      In this case, the test method assumes the flow has already completed the writing when the service is up and running.

       

      Generally, all these can be fixed by using `Tasks.waitFor` on the service call, although we have to be careful about the exception raised when making call to the service URL due the failure mentioned above, hence need to be handled appropriately.

        Attachments

          Activity

            People

            • Assignee:
              terence Terence Yim
              Reporter:
              terence Terence Yim
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: