diff --git a/src/commands/xpending.json b/src/commands/xpending.json index 8e599c6f2..6aef2f4ae 100644 --- a/src/commands/xpending.json +++ b/src/commands/xpending.json @@ -113,6 +113,30 @@ } } ] + }, + { + "description": "Summary form when there are no pending messages.", + "type": "array", + "minItems": 4, + "maxItems": 4, + "items": [ + { + "description": "Total number of pending messages", + "const": 0 + }, + { + "description": "Minimal pending entry ID", + "type": "null" + }, + { + "description": "Maximal pending entry ID", + "type": "null" + }, + { + "description": "Consumers with pending messages", + "type": "null" + } + ] } ] }, diff --git a/tests/unit/type/stream-cgroups.tcl b/tests/unit/type/stream-cgroups.tcl index 047defecf..bda35e887 100644 --- a/tests/unit/type/stream-cgroups.tcl +++ b/tests/unit/type/stream-cgroups.tcl @@ -98,6 +98,12 @@ start_server { assert {[llength $pending] == 4} } + test {XPENDING only group with an empty PEL} { + r XGROUP CREATE mystream emptygroup $ + assert_equal {0 {} {} {}} [r XPENDING mystream emptygroup] + r XGROUP DESTROY mystream emptygroup + } + test {XPENDING with IDLE} { after 20 set pending [r XPENDING mystream mygroup IDLE 99999999 - + 10 consumer-1] diff --git a/utils/req-res-log-validator.py b/utils/req-res-log-validator.py index a5e2239aa..fa9f72bde 100755 --- a/utils/req-res-log-validator.py +++ b/utils/req-res-log-validator.py @@ -236,7 +236,11 @@ def process_file(docs, path): print("Response: (unprintable)") print(f"Schema: {json.dumps(req.schema, indent=2)}") print(traceback.format_exc()) - raise + # jsonschema exceptions hold a reference to a TypeChecker lambda in + # jsonschema._types, which cannot be pickled. process_file runs in a + # multiprocessing pool worker, so re-raising one makes the parent report + # MaybeEncodingError/PicklingError instead of the validation failure. + raise RuntimeError(f"JSON schema validation error on {path}: {err}") return command_counter