handleSummary fires even when the session is terminated rather than completing successfully

Hi,

Loving using K6 it really makes writing load testing easy! I have built out a framework for delivering building block endpoint benchmark/load tests that can then be composed using the fantastic scenarios into realistic load testing for various testing scenarios. It works a charm and outputs the data to our database for tracking purposes. The only slight fly in the ointment is that if a test gets terminated the handleSummary still gets called and spurious results get written to the database polluting our tracking solution. There does not appear to be any way to determine that the scenario has been terminated in the summary results themselves. Any suggestions on how I can filter out these spurious runs?

thanks in advance

Hu @iainmxray, welcome to the community forum!

I do not think this is currently supported in any way. You might be able to use the testRunDurationMS from the summary data to figure out you are way below your expected duration, but this won’t work in all cases.

Can you please open an issue with more information and maybe some proposal if you have such.