mhjort / trombi

Load testing library for testing stateful apps with Clojure
Eclipse Public License 1.0
235 stars 19 forks source link

Dynamic scenarios #58

Closed rlefebvre closed 6 years ago

rlefebvre commented 6 years ago

As discussed in issue #48.

Hi! I am running load tests again and took time to organize the proposed fix. Sorry it took so long, I was pulled away on other projects.

mhjort commented 6 years ago

Looks great! Could you also add a test case for this in simulation_test.clj?

mhjort commented 6 years ago

One thing I noticed. If for some reason step-fndoes not return nil the tests won't stop ever. It would be better if clj-gatling obeys duration or request count always. Even in case there is a bug in step-fn and it does not return nil.

rlefebvre commented 6 years ago

I've added a basic test for step-fn. Will fix to obey duration or request count later this week.

mhjort commented 6 years ago

Looks good. Actually it works as expected now. I forgot that there is a separate :allow-early-termination? option that can be turned on. With that option it behaves as it should. Even when step-fn does not return nil ever the simulation finishes

I will merge this and add a note to documentation that you should use that :allow-early-termination? option if you want to be sure that scenario always exits when using step-fn.