risingwave_stream::executor::test_utils

Trait StreamExecutorTestExt

source
pub trait StreamExecutorTestExt: MessageStream + Unpin {
    // Provided methods
    fn next_unwrap_pending(&mut self) { ... }
    fn next_unwrap_ready(&mut self) -> StreamExecutorResult<Message> { ... }
    fn next_unwrap_ready_chunk(&mut self) -> StreamExecutorResult<StreamChunk> { ... }
    fn next_unwrap_ready_barrier(&mut self) -> StreamExecutorResult<Barrier> { ... }
    fn next_unwrap_ready_watermark(&mut self) -> StreamExecutorResult<Watermark> { ... }
    fn expect_barrier<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Barrier> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn expect_chunk<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = StreamChunk> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn expect_watermark<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Watermark> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait for testing StreamExecutor more easily.

With next_unwrap_ready, we can retrieve the next message from the executor without awaiting, so that we can immediately panic if the executor is not ready instead of getting stuck. This is useful for testing.

Provided Methods§

source

fn next_unwrap_pending(&mut self)

Asserts that the executor is pending (not ready) now.

Panics if it is ready.

source

fn next_unwrap_ready(&mut self) -> StreamExecutorResult<Message>

Asserts that the executor is ready now, returning the next message.

Panics if it is pending.

source

fn next_unwrap_ready_chunk(&mut self) -> StreamExecutorResult<StreamChunk>

Asserts that the executor is ready on a StreamChunk now, returning the next chunk.

Panics if it is pending or the next message is not a StreamChunk.

source

fn next_unwrap_ready_barrier(&mut self) -> StreamExecutorResult<Barrier>

Asserts that the executor is ready on a Barrier now, returning the next barrier.

Panics if it is pending or the next message is not a Barrier.

source

fn next_unwrap_ready_watermark(&mut self) -> StreamExecutorResult<Watermark>

Asserts that the executor is ready on a Watermark now, returning the next barrier.

Panics if it is pending or the next message is not a Watermark.

source

fn expect_barrier<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Barrier> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

source

fn expect_chunk<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = StreamChunk> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

source

fn expect_watermark<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Watermark> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Implementors§