mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
kerberized HDFS test fix if run in parallel
This commit is contained in:
parent
fb89505656
commit
63c71a7b4b
@ -1188,15 +1188,18 @@ class ClickHouseCluster:
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def wait_hdfs_to_start(self, timeout=300):
|
||||
def wait_hdfs_to_start(self, timeout=300, check_marker=False):
|
||||
start = time.time()
|
||||
while time.time() - start < timeout:
|
||||
try:
|
||||
self.hdfs_api.write_data("/somefilewithrandomname222", "1")
|
||||
logging.debug("Connected to HDFS and SafeMode disabled! ")
|
||||
if check_marker:
|
||||
self.hdfs_api.read_data("/preparations_done_marker")
|
||||
|
||||
return
|
||||
except Exception as ex:
|
||||
logging.exception("Can't connect to HDFS " + str(ex))
|
||||
logging.exception("Can't connect to HDFS or preparations are not done yet " + str(ex))
|
||||
time.sleep(1)
|
||||
|
||||
raise Exception("Can't wait HDFS to start")
|
||||
@ -1443,7 +1446,7 @@ class ClickHouseCluster:
|
||||
os.chmod(self.hdfs_kerberized_logs_dir, stat.S_IRWXO)
|
||||
run_and_check(self.base_kerberized_hdfs_cmd + common_opts)
|
||||
self.make_hdfs_api(kerberized=True)
|
||||
self.wait_hdfs_to_start()
|
||||
self.wait_hdfs_to_start(check_marker=True)
|
||||
|
||||
if self.with_mongo and self.base_mongo_cmd:
|
||||
logging.debug('Setup Mongo')
|
||||
|
@ -242,6 +242,7 @@ sleep 3
|
||||
|
||||
/usr/local/hadoop/bin/hdfs dfs -mkdir /user/specuser
|
||||
/usr/local/hadoop/bin/hdfs dfs -chown specuser /user/specuser
|
||||
echo "chown_completed" | /usr/local/hadoop/bin/hdfs dfs -appendToFile - /preparations_done_marker
|
||||
|
||||
kdestroy
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user