diff --git a/tests/unit/introspection-2.tcl b/tests/unit/introspection-2.tcl index a0cf0c30f..52a13edf7 100644 --- a/tests/unit/introspection-2.tcl +++ b/tests/unit/introspection-2.tcl @@ -118,6 +118,10 @@ start_server {tags {"introspection"}} { assert_match {*calls=1,*} [cmdstat geoadd] } {} {needs:config-resetstat} + test {COMMAND COUNT get total number of Redis commands} { + assert_morethan [r command count] 0 + } + test {COMMAND GETKEYS GET} { assert_equal {key} [r command getkeys get key] } diff --git a/utils/req-res-log-validator.py b/utils/req-res-log-validator.py index e2b9d4f8d..2cb399b6a 100755 --- a/utils/req-res-log-validator.py +++ b/utils/req-res-log-validator.py @@ -12,7 +12,6 @@ import argparse import multiprocessing import collections import io -import signal import traceback from datetime import timedelta from functools import partial @@ -169,7 +168,7 @@ class Response(object): value = Response(f, line_counter) self.json[field] = value.json if line[0] == '|': - # We don't care abou the attributes, read the real response + # We don't care about the attributes, read the real response real_res = Response(f, line_counter) self.__dict__.update(real_res.__dict__) @@ -180,7 +179,7 @@ class Response(object): def process_file(docs, path): """ - This function processes a single filegenerated by logreqres.c + This function processes a single file generated by logreqres.c """ line_counter = [0] # A list with one integer: to force python to pass it by reference command_counter = dict() @@ -190,7 +189,7 @@ def process_file(docs, path): # Convert file to StringIO in order to minimize IO operations with open(path, "r", newline="\r\n", encoding="latin-1") as f: content = f.read() - + with io.StringIO(content) as fakefile: while True: try: @@ -244,7 +243,7 @@ def fetch_schemas(cli, port, args, docs): break except Exception as e: time.sleep(0.1) - pass + print('Connected') cli_proc = subprocess.Popen([cli, '-p', str(port), '--json', 'command', 'docs'], stdout=subprocess.PIPE) @@ -310,7 +309,7 @@ if __name__ == '__main__': start = time.time() - # Obtain all the files toprocesses + # Obtain all the files to processes paths = [] for path in glob.glob('%s/tmp/*/*.reqres' % testdir): paths.append(path)