Closed longquanzheng closed 1 year ago
Found a bug introduced in the implementation when switching to use Map from Array: https://github.com/xdblab/xdb/pull/87
@zklgame it's still happening:
2023-11-10T18:32:36.3392944Z === RUN TestStateExecutionLocalQueuesTryConsumeForStateExecution_Any_consumed
2023-11-10T18:32:36.3393157Z state_execution_local_queues_json_test.go:258:
2023-11-10T18:32:36.3393874Z Error Trace: /home/runner/work/xdb/xdb/persistence/persistencetest/state_execution_local_queues_json_test.go:258
2023-11-10T18:32:36.3394033Z Error: Not equal:
2023-11-10T18:32:36.3395838Z expected: map[int][]persistence.InternalLocalQueueMessage{0:[]persistence.InternalLocalQueueMessage{persistence.InternalLocalQueueMessage{DedupId:"4d6200f7-7ff7-11ee-8735-000d3a5509ab", IsFull:false}}}
2023-11-10T18:32:36.3398654Z actual : map[int][]persistence.InternalLocalQueueMessage{1:[]persistence.InternalLocalQueueMessage{persistence.InternalLocalQueueMessage{DedupId:"4d6200fa-7ff7-11ee-8735-000d3a5509ab", IsFull:false}, persistence.InternalLocalQueueMessage{DedupId:"4d6200fb-7ff7-11ee-8735-000d3a5509ab", IsFull:false}}}
2023-11-10T18:32:36.3398796Z
2023-11-10T18:32:36.3398962Z Diff:
2023-11-10T18:32:36.3399195Z --- Expected
2023-11-10T18:32:36.3399385Z +++ Actual
2023-11-10T18:32:36.3399638Z @@ -1,5 +1,9 @@
2023-11-10T18:32:36.3400147Z (map[int][]persistence.InternalLocalQueueMessage) (len=1) {
2023-11-10T18:32:36.3400735Z - (int) 0: ([]persistence.InternalLocalQueueMessage) (len=1) {
2023-11-10T18:32:36.3401225Z + (int) 1: ([]persistence.InternalLocalQueueMessage) (len=2) {
2023-11-10T18:32:36.3401638Z (persistence.InternalLocalQueueMessage) {
2023-11-10T18:32:36.3402276Z - DedupId: (string) (len=36) "4d6200f7-7ff7-11ee-8735-000d3a5509ab",
2023-11-10T18:32:36.3402895Z + DedupId: (string) (len=36) "4d6200fa-7ff7-11ee-8735-000d3a5509ab",
2023-11-10T18:32:36.3403163Z + IsFull: (bool) false
2023-11-10T18:32:36.3403327Z + },
2023-11-10T18:32:36.3403719Z + (persistence.InternalLocalQueueMessage) {
2023-11-10T18:32:36.3404343Z + DedupId: (string) (len=36) "4d6200fb-7ff7-11ee-8735-000d3a5509ab",
2023-11-10T18:32:36.3404630Z IsFull: (bool) false
see https://github.com/xdblab/xdb/actions/runs/6828404432/job/18572463957?pr=89
Can you provide the branch name and the commit hash?
Can you provide the branch name and the commit hash?
this one: https://github.com/xdblab/xdb/pull/89/commits/8980cf503bdd7ef5ac874e9a6307a2ecdf86c312
it's on the current latest commit of the branch. I ran the test again and succeeded on the second attempt
Found the issune in the unit test. For anyOfCimplete, there is no guarantee about which command will be picked to complete if there are several commands that are able to complete.
Updated the test case: https://github.com/xdblab/xdb/pull/91
repro at https://github.com/xdblab/xdb/actions/runs/6791516741/job/18463155053?pr=80