nats-io / latency-tests

Latency and Throughput Test Framework
Apache License 2.0
17 stars 10 forks source link

Test for subscription propagation #1

Closed ColinSullivan1 closed 6 years ago

ColinSullivan1 commented 6 years ago

Sometimes tests with clustered servers hang because the first message was sent before subscription interest was propagated. This uses a test subscription to check that serverb has propagated subject interest to servera before starting the test.

Signed-off-by: Colin Sullivan colin@synadia.com

derekcollison commented 6 years ago

I think I would have a boolean regarding the route established. I would send the test subscription then send another and publish to that on the publisher connection at some interval, say every 10ms. Once you receive it you set bool and cancel the publisher, then begin the test.

ColinSullivan1 commented 6 years ago

Sounds good, will do.

ColinSullivan1 commented 6 years ago

Thanks for the suggestion. I added a test subscription to check that a route w/ subject interest has been established. Tested manually locally and on GCE instances. Rather than use a bool and lock, I used an int32 to take advantage of the atomic APIs. wdyt?

derekcollison commented 6 years ago

LGTM

ColinSullivan1 commented 6 years ago

Thanks Derek!