Skip to content

Commit

Permalink
add changes
Browse files Browse the repository at this point in the history
Signed-off-by: Divya Madala <[email protected]>
  • Loading branch information
Divyaasm committed Apr 4, 2024
1 parent 4338d82 commit 6d071ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ echo "Installing dependencies in $DIR ..."
export PIPENV_PIPFILE="$DIR/Pipfile"
python3 -m pipenv install

echo "Running "$1" ${@:2} ..."
if [[ ! "$1" == *benchmark* ]]; then (echo "Running "$1" ${@:2} ..."; ); fi
python3 -m pipenv run python "$1" ${@:2}
8 changes: 4 additions & 4 deletions src/test_workflow/benchmark_test/benchmark_test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def __init__(
self.args = args
self.cluster_endpoint = self.args.cluster_endpoint
self.cluster_endpoint_with_port = None
self.password = None
self.password = self.args.password

def start(self) -> None:

command = f"curl http://{self.cluster_endpoint}" if self.args.insecure else f"curl https://{self.cluster_endpoint} -ku f'{self.args.username}:{self.args.password}'"
try:
result = subprocess.run(command, shell=True, capture_output=True, timeout=5)
except subprocess.TimeoutExpired:
raise TimeoutError(f"Time out! Couldn't connect to the cluster {self.cluster_endpoint}")
raise TimeoutError(f"Time out! Couldn't connect to the cluster")

if result.stdout:
res_dict = json.loads(result.stdout)
Expand All @@ -65,10 +65,10 @@ def fetch_password(self) -> str:
return self.password

def wait_for_processing(self, tries: int = 3, delay: int = 15, backoff: int = 2) -> None:
logging.info(f"Waiting for domain at {self.endpoint} to be up")
logging.info(f"Waiting for domain ******* to be up")
protocol = "http://" if self.args.insecure else "https://"
url = "".join([protocol, self.endpoint, "/_cluster/health"])
self.password = None if self.args.insecure else get_password(self.args.distribution_version)
# self.password = None if self.args.insecure else get_password(self.args.distribution_version)
request_args = {"url": url} if self.args.insecure else {"url": url, "auth": HTTPBasicAuth(self.args.username, self.args.password), # type: ignore
"verify": False} # type: ignore
retry_call(requests.get, fkwargs=request_args, tries=tries, delay=delay, backoff=backoff)
1 change: 0 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ case $1 in
"$DIR/run.sh" "$DIR/src/run_perf_test.py" "${@:2}"
;;
"benchmark-test")
echo "the parameters passed are ${@:2}"
"$DIR/run.sh" "$DIR/src/run_benchmark_test.py" "${@:2}"
;;
*)
Expand Down

0 comments on commit 6d071ca

Please sign in to comment.