Skip to content

Commit

Permalink
Add 300sec client timeout to benchmark command (#3592)
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Singh <sngri@amazon.com>
  • Loading branch information
rishabh6788 authored Jun 1, 2023
1 parent edf846d commit 822fd36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/test_workflow/benchmark_test/benchmark_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def __init__(

def execute(self) -> None:
if self.security:
self.command += ' --client-options="use_ssl:true,verify_certs:false,basic_auth_user:\'admin\',basic_auth_password:\'admin\'"'
self.command += ' --client-options="timeout:300,use_ssl:true,verify_certs:false,basic_auth_user:\'admin\',basic_auth_password:\'admin\'"'
else:
self.command += ' --client-options="timeout:300"'
logging.info(f"Executing {self.command}")
subprocess.check_call(f"{self.command}", cwd=os.getcwd(), shell=True)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_execute_default(self) -> None:
self.assertEqual(mock_check_call.call_count, 1)
self.assertEqual(self.benchmark_test_suite.command,
'docker run --rm opensearchproject/opensearch-benchmark:latest execute-test --workload=nyc_taxis '
'--pipeline=benchmark-only --target-hosts=abc.com')
'--pipeline=benchmark-only --target-hosts=abc.com --client-options="timeout:300"')

def test_execute_security_enabled(self) -> None:
benchmark_test_suite = BenchmarkTestSuite(endpoint=self.endpoint, security=True, args=self.args)
Expand All @@ -40,7 +40,7 @@ def test_execute_security_enabled(self) -> None:
self.assertEqual(benchmark_test_suite.command,
'docker run --rm opensearchproject/opensearch-benchmark:latest execute-test '
'--workload=nyc_taxis --pipeline=benchmark-only '
'--target-hosts=abc.com --client-options="use_ssl:true,'
'--target-hosts=abc.com --client-options="timeout:300,use_ssl:true,'
'verify_certs:false,basic_auth_user:\'admin\',basic_auth_password:\'admin\'"')

def test_execute_default_with_optional_args(self) -> None:
Expand All @@ -54,4 +54,4 @@ def test_execute_default_with_optional_args(self) -> None:
'--workload=nyc_taxis '
'--pipeline=benchmark-only --target-hosts=abc.com '
'--workload-params "number_of_replicas:1" '
'--user-tag="key1:value1,key2:value2" --telemetry node-stats')
'--user-tag="key1:value1,key2:value2" --telemetry node-stats --client-options="timeout:300"')

0 comments on commit 822fd36

Please sign in to comment.