Normalize hostname in CI

This commit is contained in:
Amos Bird 2021-08-02 21:51:33 +08:00
parent 98326ec028
commit b541b5eca3
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
3 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,7 @@ except ImportError:
import random
import string
import multiprocessing
import socket
from contextlib import closing
USE_JINJA = True
@ -267,6 +268,9 @@ def run_single_test(args, ext, server_logs_level, client_options, case_file, std
os.system("LC_ALL=C sed -i -e 's|/auto_{{shard}}||g' {file}".format(file=stdout_file))
os.system("LC_ALL=C sed -i -e 's|auto_{{replica}}||g' {file}".format(file=stdout_file))
# Normalize hostname in stdout file.
os.system("LC_ALL=C sed -i -e 's/{hostname}/localhost/g' {file}".format(hostname=socket.gethostname(), file=stdout_file))
stdout = open(stdout_file, 'rb').read() if os.path.exists(stdout_file) else b''
stdout = str(stdout, errors='replace', encoding='utf-8')
stderr = open(stderr_file, 'rb').read() if os.path.exists(stderr_file) else b''

View File

@ -0,0 +1,2 @@
localhost
localhost 2

View File

@ -0,0 +1,2 @@
select hostname();
select hostName() h, count() from cluster(test_cluster_two_shards, system.one) group by h;