Skip to content
Snippets Groups Projects
Commit cdf3e7af authored by David Fairbrother's avatar David Fairbrother
Browse files

Make KafkaDecoder tests run Lockstep to fix races

Converts the Kafka[Event/Histo]StreamDecoder tests to run in lockstep
whenever possible. The previous version held the unit test for n number
of Kafka steps then let both threads run free.

This fixes numerous races resulting in flakey tests, for example is
HistoStreamDecoder we waited for 1 iteration whereas three was required.
Rather than just tweaking the values and hoping this new mechanism will
deadlock if the threads get into a race-y condition. A timeout ensures
that after 2 minutes we fail with an abort stating we deadlocked.

This flushed out multiple races in the StreamDecoder too, however some
tests which rely on the EndOfRunStream have to run unsyncronised: The
the thread will block and the Kafka thread waits for ExtractData to be
called, causing a deadlock. If we are having problems in the future that
would be the first place to look, however for this commit it's out of
scope.
parent 3b7f9634
No related branches found
No related tags found
No related merge requests found
Showing
with 338 additions and 231 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment