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


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


      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.




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


              • Created: