Open mapleFU opened 1 month ago
I'm guessing that's because the WriteArgs
command was actually accepted by the server later than the next two RPUSHs
require.NoError(t, rdb.RPush(ctx, key2, "one", "two").Err()) // 1
require.NoError(t, rdb.RPush(ctx, key1, "ONE", "TWO").Err()) // 2
require.NoError(t, rd.WriteArgs("blmpop", "1", "2", key1, key2, direction, "count", "2")) // 3
The most simple solution is to add a sleep, but this can be confusing in testing, because some WriteArgs
don't require the code to be executed exactly in the order of the code, as long as it has been executed, and sleep is not required.
We may need a clearer way to articulate our testing expectations, what do you think?
I'd like to eliminate sleep from the test as much as possible, or add comments to sleep.
Keep and add comments
Identify and eliminate: Unnecessary sleep
Identify and eliminate/ add comments: Unclear why sleep is needed. They might be hiding some issues. We might need to clear them all first and then determine whether we need to sleep and why we need to do so.
Search before asking
Version
See: https://github.com/apache/kvrocks/actions/runs/11444706001/job/31841260069?pr=2615
Minimal reproduce step
https://github.com/apache/kvrocks/actions/runs/11444706001/job/31841260069?pr=2615
What did you expect to see?
Pass
What did you see instead?
See above
Anything Else?
no
Are you willing to submit a PR?