Skip to content

Can't test for table build delays? #54

@Miles-Garnsey

Description

@Miles-Garnsey

When Kafka builds a local table, it often takes some time to stream all of the records in. This means that doing a join against this table may fail due to the matching record not yet appearing.

I am trying to write a test to detect this issue, with topology and inputs as below;

val mstreams = MockedStreams()
     .topology(b => {
       ...some join logic...
       })
       .input(StreamforTable,
       someserde,
       someserde,
       irrelevantInputForTable) //A seq with 100 000 elements.
      .input(StreamForTable,
       someserde,
       someserde,
       relevantInputForTable) // A seq with one element that matches the third input() call.
     .input(StreamToJoin,
       someserde,
       someserde,
       singleRecordShouldMatch)

The intention is that the irrelevant input (in the first call to input()) should overwhelm the app, causing a delay in adding the relevant input (in the second call to input()) to the table. The join should then fail. But it appears that the input() calls are processed sequentially, which means that this isn't working.

Does anyone have any ideas on how to write this test?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions