FundingCircle / jackdaw

A Clojure library for the Apache Kafka distributed streaming platform.
https://fundingcircle.github.io/jackdaw/
BSD 3-Clause "New" or "Revised" License
369 stars 80 forks source link

Race-condition in rest-proxy transport #146

Open cddr opened 5 years ago

cddr commented 5 years ago

Astute followers may have noticed some flakeyness in the rest-proxy transport test. On closer inspection, this does indeed seem like a bug although I'm not quite sure yet how it's happening. When the transport is created, it is supposed to wait until the consumer has performed at least one poll before it "starts" the producer and allows any messages to be submitted by the test machine. This is intended to ensure that the journal captures all output initiated by the current test.

https://github.com/FundingCircle/jackdaw/blob/master/src/jackdaw/test/transports/rest_proxy.clj#L289

However careful inspection of the log for a test failure reveals that when the test intermittently fails, it looks like the producer is indeed being "started" before the consumer