mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix invalid escape sequence warnings
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
a474816fc7
commit
b2535d7f50
@ -8,7 +8,7 @@ sys.path.insert(0, os.path.join(CURDIR))
|
||||
|
||||
from . import uexpect
|
||||
|
||||
prompt = ":\) "
|
||||
prompt = ":\\) "
|
||||
end_of_block = r".*\r\n.*\r\n"
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ class client(object):
|
||||
self.client.eol("\r")
|
||||
self.client.logger(log, prefix=name)
|
||||
self.client.timeout(20)
|
||||
self.client.expect("[#\$] ", timeout=2)
|
||||
self.client.expect("[#\\$] ", timeout=2)
|
||||
self.client.send(command)
|
||||
|
||||
def __enter__(self):
|
||||
|
@ -28,7 +28,7 @@ def parse_response_line(line):
|
||||
|
||||
if line.startswith("#"):
|
||||
return {}
|
||||
match = re.match("^([a-zA-Z_:][a-zA-Z0-9_:]+)(\{.*\})? -?(\d)", line)
|
||||
match = re.match(r"^([a-zA-Z_:][a-zA-Z0-9_:]+)(\{.*\})? -?(\d)", line)
|
||||
assert match, line
|
||||
name, _, val = match.groups()
|
||||
return {name: int(val)}
|
||||
|
@ -49,16 +49,16 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
client1.send("WATCH 01056_window_view_proc_hop_watch.wv")
|
||||
client1.expect("Query id" + end_of_block)
|
||||
client1.expect("Progress: 0.00 rows.*\)")
|
||||
client1.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01056_window_view_proc_hop_watch.mt VALUES (1, now('US/Samoa') + 3)"
|
||||
)
|
||||
client1.expect("1" + end_of_block)
|
||||
client1.expect("Progress: 1.00 rows.*\)")
|
||||
client1.expect("Progress: 1.00 rows.*\\)")
|
||||
|
||||
# send Ctrl-C
|
||||
client1.send("\x03", eol="")
|
||||
match = client1.expect("(%s)|([#\$] )" % prompt)
|
||||
match = client1.expect("(%s)|([#\\$] )" % prompt)
|
||||
if match.groups()[1]:
|
||||
client1.send(client1.command)
|
||||
client1.expect(prompt)
|
||||
|
@ -47,7 +47,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
client1.send("WATCH db_01059_event_hop_watch_strict_asc.wv")
|
||||
client1.expect("Query id" + end_of_block)
|
||||
client1.expect("Progress: 0.00 rows.*\)")
|
||||
client1.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO db_01059_event_hop_watch_strict_asc.mt VALUES (1, toDateTime('1990/01/01 12:00:00', 'US/Samoa'));"
|
||||
)
|
||||
@ -57,7 +57,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
)
|
||||
client2.expect("Ok.")
|
||||
client1.expect("1*1990-01-01 12:00:02" + end_of_block)
|
||||
client1.expect("Progress: 1.00 rows.*\)")
|
||||
client1.expect("Progress: 1.00 rows.*\\)")
|
||||
|
||||
client2.send(
|
||||
"INSERT INTO db_01059_event_hop_watch_strict_asc.mt VALUES (1, toDateTime('1990/01/01 12:00:10', 'US/Samoa'));"
|
||||
@ -65,11 +65,11 @@ with client(name="client1>", log=log) as client1, client(
|
||||
client2.expect("Ok.")
|
||||
client1.expect("1*1990-01-01 12:00:06" + end_of_block)
|
||||
client1.expect("1*1990-01-01 12:00:08" + end_of_block)
|
||||
client1.expect("Progress: 3.00 rows.*\)")
|
||||
client1.expect("Progress: 3.00 rows.*\\)")
|
||||
|
||||
# send Ctrl-C
|
||||
client1.send("\x03", eol="")
|
||||
match = client1.expect("(%s)|([#\$] )" % prompt)
|
||||
match = client1.expect("(%s)|([#\\$] )" % prompt)
|
||||
if match.groups()[1]:
|
||||
client1.send(client1.command)
|
||||
client1.expect(prompt)
|
||||
|
@ -49,7 +49,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
client1.send("WATCH 01062_window_view_event_hop_watch_asc.wv")
|
||||
client1.expect("Query id" + end_of_block)
|
||||
client1.expect("Progress: 0.00 rows.*\)")
|
||||
client1.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01062_window_view_event_hop_watch_asc.mt VALUES (1, toDateTime('1990/01/01 12:00:00', 'US/Samoa'));"
|
||||
)
|
||||
@ -69,11 +69,11 @@ with client(name="client1>", log=log) as client1, client(
|
||||
client2.expect(prompt)
|
||||
client1.expect("1" + end_of_block)
|
||||
client1.expect("2" + end_of_block)
|
||||
client1.expect("Progress: 3.00 rows.*\)")
|
||||
client1.expect("Progress: 3.00 rows.*\\)")
|
||||
|
||||
# send Ctrl-C
|
||||
client1.send("\x03", eol="")
|
||||
match = client1.expect("(%s)|([#\$] )" % prompt)
|
||||
match = client1.expect("(%s)|([#\\$] )" % prompt)
|
||||
if match.groups()[1]:
|
||||
client1.send(client1.command)
|
||||
client1.expect(prompt)
|
||||
|
@ -50,7 +50,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
client1.send("WATCH 01065_window_view_event_hop_watch_bounded.wv")
|
||||
client1.expect("Query id" + end_of_block)
|
||||
client1.expect("Progress: 0.00 rows.*\)")
|
||||
client1.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01065_window_view_event_hop_watch_bounded.mt VALUES (1, '1990/01/01 12:00:00');"
|
||||
)
|
||||
@ -72,7 +72,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
# send Ctrl-C
|
||||
client1.send("\x03", eol="")
|
||||
match = client1.expect("(%s)|([#\$] )" % prompt)
|
||||
match = client1.expect("(%s)|([#\\$] )" % prompt)
|
||||
if match.groups()[1]:
|
||||
client1.send(client1.command)
|
||||
client1.expect(prompt)
|
||||
|
@ -49,23 +49,23 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
client1.send("WATCH 01069_window_view_proc_tumble_watch.wv")
|
||||
client1.expect("Query id" + end_of_block)
|
||||
client1.expect("Progress: 0.00 rows.*\)")
|
||||
client1.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01069_window_view_proc_tumble_watch.mt VALUES (1, now('US/Samoa') + 3)"
|
||||
)
|
||||
client2.expect("Ok.")
|
||||
client1.expect("1" + end_of_block)
|
||||
client1.expect("Progress: 1.00 rows.*\)")
|
||||
client1.expect("Progress: 1.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01069_window_view_proc_tumble_watch.mt VALUES (1, now('US/Samoa') + 3)"
|
||||
)
|
||||
client2.expect("Ok.")
|
||||
client1.expect("1" + end_of_block)
|
||||
client1.expect("Progress: 2.00 rows.*\)")
|
||||
client1.expect("Progress: 2.00 rows.*\\)")
|
||||
|
||||
# send Ctrl-C
|
||||
client1.send("\x03", eol="")
|
||||
match = client1.expect("(%s)|([#\$] )" % prompt)
|
||||
match = client1.expect("(%s)|([#\\$] )" % prompt)
|
||||
if match.groups()[1]:
|
||||
client1.send(client1.command)
|
||||
client1.expect(prompt)
|
||||
|
@ -49,7 +49,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
client1.send("WATCH 01070_window_view_watch_events.wv EVENTS")
|
||||
client1.expect("Query id" + end_of_block)
|
||||
client1.expect("Progress: 0.00 rows.*\)")
|
||||
client1.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01070_window_view_watch_events.mt VALUES (1, toDateTime('1990/01/01 12:00:00', 'US/Samoa'));"
|
||||
)
|
||||
@ -59,11 +59,11 @@ with client(name="client1>", log=log) as client1, client(
|
||||
)
|
||||
client2.expect("Ok.")
|
||||
client1.expect("1990-01-01 12:00:05" + end_of_block)
|
||||
client1.expect("Progress: 1.00 rows.*\)")
|
||||
client1.expect("Progress: 1.00 rows.*\\)")
|
||||
|
||||
# send Ctrl-C
|
||||
client1.send("\x03", eol="")
|
||||
match = client1.expect("(%s)|([#\$] )" % prompt)
|
||||
match = client1.expect("(%s)|([#\\$] )" % prompt)
|
||||
if match.groups()[1]:
|
||||
client1.send(client1.command)
|
||||
client1.expect(prompt)
|
||||
|
@ -55,7 +55,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
client1.send("WATCH 01078_window_view_alter_query_watch.wv")
|
||||
client1.expect("Query id" + end_of_block)
|
||||
client1.expect("Progress: 0.00 rows.*\)")
|
||||
client1.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01078_window_view_alter_query_watch.mt VALUES (1, toDateTime('1990/01/01 12:00:00', 'US/Samoa'));"
|
||||
)
|
||||
@ -65,7 +65,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
)
|
||||
client2.expect("Ok.")
|
||||
client1.expect("1" + end_of_block)
|
||||
client1.expect("Progress: 1.00 rows.*\)")
|
||||
client1.expect("Progress: 1.00 rows.*\\)")
|
||||
client2.send(
|
||||
"ALTER TABLE 01078_window_view_alter_query_watch.wv MODIFY QUERY SELECT count(a) * 2 AS count, hopEnd(wid) AS w_end FROM 01078_window_view_alter_query_watch.mt GROUP BY hop(timestamp, INTERVAL '2' SECOND, INTERVAL '3' SECOND, 'US/Samoa') AS wid"
|
||||
)
|
||||
@ -75,7 +75,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
client1.expect(prompt)
|
||||
client3.send("WATCH 01078_window_view_alter_query_watch.wv")
|
||||
client3.expect("Query id" + end_of_block)
|
||||
client3.expect("Progress: 0.00 rows.*\)")
|
||||
client3.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01078_window_view_alter_query_watch.mt VALUES (1, toDateTime('1990/01/01 12:00:06', 'US/Samoa'));"
|
||||
)
|
||||
@ -85,11 +85,11 @@ with client(name="client1>", log=log) as client1, client(
|
||||
)
|
||||
client2.expect("Ok.")
|
||||
client3.expect("2" + end_of_block)
|
||||
client3.expect("Progress: 1.00 rows.*\)")
|
||||
client3.expect("Progress: 1.00 rows.*\\)")
|
||||
|
||||
# send Ctrl-C
|
||||
client3.send("\x03", eol="")
|
||||
match = client3.expect("(%s)|([#\$] )" % prompt)
|
||||
match = client3.expect("(%s)|([#\\$] )" % prompt)
|
||||
if match.groups()[1]:
|
||||
client3.send(client3.command)
|
||||
client3.expect(prompt)
|
||||
|
@ -49,7 +49,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
|
||||
client1.send("WATCH 01082_window_view_watch_limit.wv LIMIT 1")
|
||||
client1.expect("Query id" + end_of_block)
|
||||
client1.expect("Progress: 0.00 rows.*\)")
|
||||
client1.expect("Progress: 0.00 rows.*\\)")
|
||||
client2.send(
|
||||
"INSERT INTO 01082_window_view_watch_limit.mt VALUES (1, '1990/01/01 12:00:00');"
|
||||
)
|
||||
@ -59,7 +59,7 @@ with client(name="client1>", log=log) as client1, client(
|
||||
)
|
||||
client2.expect("Ok.")
|
||||
client1.expect("1" + end_of_block)
|
||||
client1.expect("Progress: 1.00 rows.*\)")
|
||||
client1.expect("Progress: 1.00 rows.*\\)")
|
||||
client1.expect("1 row" + end_of_block)
|
||||
client1.expect(prompt)
|
||||
|
||||
|
@ -15,6 +15,6 @@ log = None
|
||||
with client(name="client1>", log=log) as client1:
|
||||
client1.expect(prompt)
|
||||
client1.send("SELECT number FROM numbers(1000) FORMAT Null")
|
||||
client1.expect("Progress: 1\.00 thousand rows, 8\.00 KB .*" + end_of_block)
|
||||
client1.expect("0 rows in set. Elapsed: [\\w]{1}\.[\\w]{3} sec.")
|
||||
client1.expect("Progress: 1\\.00 thousand rows, 8\\.00 KB .*" + end_of_block)
|
||||
client1.expect("0 rows in set. Elapsed: [\\w]{1}\\.[\\w]{3} sec.")
|
||||
client1.expect("Peak memory usage: .*B" + end_of_block)
|
||||
|
@ -32,12 +32,12 @@ with client(
|
||||
)
|
||||
client1.expect(prompt)
|
||||
client1.send(f"INSERT INTO test.infile_progress FROM INFILE '{filename}'")
|
||||
client1.expect("Progress: 5.00 rows, 10.00 B.*\)")
|
||||
client1.expect("Progress: 5.00 rows, 10.00 B.*\\)")
|
||||
client1.expect(prompt)
|
||||
|
||||
# send Ctrl-C
|
||||
client1.send("\x03", eol="")
|
||||
match = client1.expect("(%s)|([#\$] )" % prompt)
|
||||
match = client1.expect("(%s)|([#\\$] )" % prompt)
|
||||
if match.groups()[1]:
|
||||
client1.send(client1.command)
|
||||
client1.expect(prompt)
|
||||
|
@ -8,7 +8,7 @@ sys.path.insert(0, os.path.join(CURDIR))
|
||||
|
||||
import uexpect
|
||||
|
||||
prompt = ":\) "
|
||||
prompt = ":\\) "
|
||||
end_of_block = r".*\r\n.*\r\n"
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ class client(object):
|
||||
self.client.eol("\r")
|
||||
self.client.logger(log, prefix=name)
|
||||
self.client.timeout(120)
|
||||
self.client.expect("[#\$] ", timeout=60)
|
||||
self.client.expect("[#\\$] ", timeout=60)
|
||||
self.client.send(command)
|
||||
|
||||
def __enter__(self):
|
||||
|
@ -10,7 +10,7 @@ import uexpect
|
||||
|
||||
|
||||
class shell(object):
|
||||
def __init__(self, command=None, name="", log=None, prompt="[#\$] "):
|
||||
def __init__(self, command=None, name="", log=None, prompt="[#\\$] "):
|
||||
if command is None:
|
||||
command = ["/bin/bash", "--noediting"]
|
||||
self.prompt = prompt
|
||||
|
Loading…
Reference in New Issue
Block a user