[CI] 【Hackathon 9th Sprint No.34】NO.34 功能模块单测补充 by xunyoyo · Pull Request #5057 · PaddlePaddle/FastDeploy (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rpop method has a potential bug when an empty list exists for a key. If bucket is an empty list (which is falsy), the method returns None, but it should attempt to pop from the empty list (which would raise an IndexError) or return an empty list. This inconsistency could lead to incorrect test behavior.

Consider changing line 117 to:

if bucket is None or not bucket:

Or better yet, check the bucket state more explicitly to match Redis behavior.