[BDDFramework] How to test Light Processes with BDD Scenarios?

Forge Component
Published on 2019-12-02 by João Proença
23 votes
Published on 2019-12-02 by João Proença

Hi folks,

I've had a previous challenge of testing a Timer through BDD Scenarios: this was successfully achieved by making the Timer_* action public to my *_Tests module and creating a special input parameter to make the timer action synchronous (i.e. no longer rescheduling the Timer in its flow). This proved successful at least with a small sample test data set.

My next challenge is to convert a timer to Light Processes, since, for performance reasons, our application is now requiring parallel processing. In regards to upgrading our existing BDD Scenarios to support Light Processes, are there any suggestions you would recommend? 

I'm thinking on a simple Wait cycle (for X seconds), hoping this could cover the parallel processing of the small sample test data set, which can then be asserted. I understand this may result in potential timeouts to the remaining cases in my Test Suite, but can't currently find any particular way to design this scenario. Any ideas?


Maybe you can work with 2 Timestamps and compare them in a loop. One, that you store at the start and the 2nd one is the CurrDateTime(), then you create a loop and check DiffSeconds(,) > X seconds.

You could make it work in such a way where the last light process to run could check if all the other are finished and if so then you run the necessary code afterwards.

If you are working with batches of data this should be easy to do by checking if the other batches are still being processed or not.

Thanks guys, 

SaxoTom: that's exactly what I had in mind for the wait logic. 

Luís: the currently planned implementation for the light process will definitely be doing that sort of final logic, but I guess it'll be its outcome (e.g. a status on my sample test record) that I'll be validating on my BDD Then Step.

Glad to know I'm on the right track. Thanks so much,