summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2023-03-26 13:39:04 +0800
committerGitHub <noreply@github.com>2023-03-26 08:39:04 +0300
commit2cc99c692c4984f5d9c42e4d2d25fa70125ef0a7 (patch)
tree0b123ff4e1c5fef027b00e7d77dc5e1dcf45361f /utils
parent9e15b42fda8fa622edf6a1e15cba0fc066a35407 (diff)
downloadredis-2cc99c692c4984f5d9c42e4d2d25fa70125ef0a7.tar.gz
Add COMMAND COUNT test to cover reply-schemas-validator test (#11971)
Since we remove the COMMAND COUNT call in sentinel test in #11950, reply-schemas-validator started reporting this error: ``` WARNING! The following commands were not hit at all: command|count ERROR! at least one command was not hit by the tests ``` This PR add a COMMAND COUNT test to cover it and also fix some typos in req-res-log-validator.py
Diffstat (limited to 'utils')
-rwxr-xr-xutils/req-res-log-validator.py11
1 files changed, 5 insertions, 6 deletions
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)