tzatziki icon indicating copy to clipboard operation
tzatziki copied to clipboard

assert multiple message on kafka message using "within" doesn't work

Open vbrune14 opened this issue 5 months ago • 1 comments

if you want to assert that X (x>1) messages are received in a kafka topic within XXXXXms, you will in most cases receive a false

Indeed, the "within" parameter will do a check every 100ms, so every 100ms it will poll messages, if one message is received, this "alone" message will be compared with a list (=> false) and immediately forget, then others polls will be done, each time comparing "alone" message with list and forget the "alone" message The only case of success is if all message arrived in the same poll....

fix will consist in keeping in memory all the previous polled message, and compare the full list with the expected list

/!\ don't forget compliance with assertion on unique message , comparaison with "alone" message is ok

vbrune14 avatar Sep 18 '24 14:09 vbrune14