From 80f30960c081e5d4fd92a7b9a35e05d165ef51d1 Mon Sep 17 00:00:00 2001 From: Eric Fu Date: Mon, 28 Nov 2022 16:11:06 +0800 Subject: [PATCH] fix: ChunkBuilder asserts empty size only for debug build (#6621) fix: ChunkBuilder checks non-empty only for debug build Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- src/stream/src/common/builder.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stream/src/common/builder.rs b/src/stream/src/common/builder.rs index 8fc70547bef69..91954ab9f0111 100644 --- a/src/stream/src/common/builder.rs +++ b/src/stream/src/common/builder.rs @@ -45,7 +45,8 @@ pub struct StreamChunkBuilder { impl Drop for StreamChunkBuilder { fn drop(&mut self) { - assert_eq!(self.size, 0, "dropping non-empty stream chunk builder"); + // Possible to fail in some corner cases but should not in unit tests + debug_assert_eq!(self.size, 0, "dropping non-empty stream chunk builder"); } }