Skip to content

Commit

Permalink
chore(derive): test channel reader flushing (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell authored Oct 8, 2024
1 parent 01cb17c commit 0a1ca04
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/derive/src/stages/channel_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ mod test {
data.into()
}

#[tokio::test]
async fn test_flush_channel_reader() {
let mock = MockChannelReaderProvider::new(vec![Ok(Some(new_compressed_batch_data()))]);
let mut reader = ChannelReader::new(mock, Arc::new(RollupConfig::default()));
reader.next_batch = Some(BatchReader::from(new_compressed_batch_data()));
reader.flush_channel().await.unwrap();
assert!(reader.next_batch.is_none());
}

#[tokio::test]
async fn test_reset_channel_reader() {
let mock = MockChannelReaderProvider::new(vec![Ok(None)]);
Expand Down

0 comments on commit 0a1ca04

Please sign in to comment.