From 6de20c1c95c54c8fe110176fb80787e00374d4f2 Mon Sep 17 00:00:00 2001 From: Alex E Date: Mon, 30 Dec 2024 22:28:55 -0500 Subject: [PATCH] Make intent clear in options used by UTs --- .../otlp/test/otlp_http_exporter_test.cc | 28 ++++++++++++------- .../otlp_http_log_record_exporter_test.cc | 28 ++++++++++++------- .../test/otlp_http_metric_exporter_test.cc | 28 ++++++++++++------- 3 files changed, 54 insertions(+), 30 deletions(-) diff --git a/exporters/otlp/test/otlp_http_exporter_test.cc b/exporters/otlp/test/otlp_http_exporter_test.cc index e193a1c2e3..5928a39fca 100644 --- a/exporters/otlp/test/otlp_http_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_exporter_test.cc @@ -64,18 +64,26 @@ OtlpHttpClientOptions MakeOtlpHttpClientOptions(HttpRequestContentType content_t options.console_debug = true; options.timeout = std::chrono::system_clock::duration::zero(); options.http_headers.insert(std::make_pair("Custom-Header-Key", "Custom-Header-Value")); + options.retry_policy_max_attempts = 0U; + options.retry_policy_initial_backoff = 0.0f; + options.retry_policy_max_backoff = 0.0f; + options.retry_policy_backoff_multiplier = 0.0f; OtlpHttpClientOptions otlp_http_client_options( - options.url, false, /* ssl_insecure_skip_verify */ - "", /* ssl_ca_cert_path */ "", /* ssl_ca_cert_string */ - "", /* ssl_client_key_path */ - "", /* ssl_client_key_string */ "", /* ssl_client_cert_path */ - "", /* ssl_client_cert_string */ - "", /* ssl_min_tls */ - "", /* ssl_max_tls */ - "", /* ssl_cipher */ - "", /* ssl_cipher_suite */ + options.url, false, /* ssl_insecure_skip_verify */ + "", /* ssl_ca_cert_path */ + "", /* ssl_ca_cert_string */ + "", /* ssl_client_key_path */ + "", /* ssl_client_key_string */ + "", /* ssl_client_cert_path */ + "", /* ssl_client_cert_string */ + "", /* ssl_min_tls */ + "", /* ssl_max_tls */ + "", /* ssl_cipher */ + "", /* ssl_cipher_suite */ options.content_type, options.json_bytes_mapping, options.compression, options.use_json_name, - options.console_debug, options.timeout, options.http_headers, 0, 0.0, 0.0, 0); + options.console_debug, options.timeout, options.http_headers, + options.retry_policy_max_attempts, options.retry_policy_initial_backoff, + options.retry_policy_max_backoff, options.retry_policy_backoff_multiplier); if (!async_mode) { otlp_http_client_options.max_concurrent_requests = 0; diff --git a/exporters/otlp/test/otlp_http_log_record_exporter_test.cc b/exporters/otlp/test/otlp_http_log_record_exporter_test.cc index 4c5405ecb6..09fbc23eee 100644 --- a/exporters/otlp/test/otlp_http_log_record_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_log_record_exporter_test.cc @@ -58,18 +58,26 @@ OtlpHttpClientOptions MakeOtlpHttpClientOptions(HttpRequestContentType content_t options.content_type = content_type; options.console_debug = true; options.http_headers.insert(std::make_pair("Custom-Header-Key", "Custom-Header-Value")); + options.retry_policy_max_attempts = 0U; + options.retry_policy_initial_backoff = 0.0f; + options.retry_policy_max_backoff = 0.0f; + options.retry_policy_backoff_multiplier = 0.0f; OtlpHttpClientOptions otlp_http_client_options( - options.url, false, /* ssl_insecure_skip_verify */ - "", /* ssl_ca_cert_path */ "", /* ssl_ca_cert_string */ - "", /* ssl_client_key_path */ - "", /* ssl_client_key_string */ "", /* ssl_client_cert_path */ - "", /* ssl_client_cert_string */ - "", /* ssl_min_tls */ - "", /* ssl_max_tls */ - "", /* ssl_cipher */ - "", /* ssl_cipher_suite */ + options.url, false, /* ssl_insecure_skip_verify */ + "", /* ssl_ca_cert_path */ + "", /* ssl_ca_cert_string */ + "", /* ssl_client_key_path */ + "", /* ssl_client_key_string */ + "", /* ssl_client_cert_path */ + "", /* ssl_client_cert_string */ + "", /* ssl_min_tls */ + "", /* ssl_max_tls */ + "", /* ssl_cipher */ + "", /* ssl_cipher_suite */ options.content_type, options.json_bytes_mapping, options.compression, options.use_json_name, - options.console_debug, options.timeout, options.http_headers, 0, 0.0, 0.0, 0); + options.console_debug, options.timeout, options.http_headers, + options.retry_policy_max_attempts, options.retry_policy_initial_backoff, + options.retry_policy_max_backoff, options.retry_policy_backoff_multiplier); if (!async_mode) { otlp_http_client_options.max_concurrent_requests = 0; diff --git a/exporters/otlp/test/otlp_http_metric_exporter_test.cc b/exporters/otlp/test/otlp_http_metric_exporter_test.cc index b7420008d9..1ce39416f1 100644 --- a/exporters/otlp/test/otlp_http_metric_exporter_test.cc +++ b/exporters/otlp/test/otlp_http_metric_exporter_test.cc @@ -80,18 +80,26 @@ OtlpHttpClientOptions MakeOtlpHttpClientOptions(HttpRequestContentType content_t options.content_type = content_type; options.console_debug = true; options.http_headers.insert(std::make_pair("Custom-Header-Key", "Custom-Header-Value")); + options.retry_policy_max_attempts = 0U; + options.retry_policy_initial_backoff = 0.0f; + options.retry_policy_max_backoff = 0.0f; + options.retry_policy_backoff_multiplier = 0.0f; OtlpHttpClientOptions otlp_http_client_options( - options.url, false, /* ssl_insecure_skip_verify */ - "", /* ssl_ca_cert_path */ "", /* ssl_ca_cert_string */ - "", /* ssl_client_key_path */ - "", /* ssl_client_key_string */ "", /* ssl_client_cert_path */ - "", /* ssl_client_cert_string */ - "", /* ssl_min_tls */ - "", /* ssl_max_tls */ - "", /* ssl_cipher */ - "", /* ssl_cipher_suite */ + options.url, false, /* ssl_insecure_skip_verify */ + "", /* ssl_ca_cert_path */ + "", /* ssl_ca_cert_string */ + "", /* ssl_client_key_path */ + "", /* ssl_client_key_string */ + "", /* ssl_client_cert_path */ + "", /* ssl_client_cert_string */ + "", /* ssl_min_tls */ + "", /* ssl_max_tls */ + "", /* ssl_cipher */ + "", /* ssl_cipher_suite */ options.content_type, options.json_bytes_mapping, options.compression, options.use_json_name, - options.console_debug, options.timeout, options.http_headers, 0, 0.0, 0.0, 0); + options.console_debug, options.timeout, options.http_headers, + options.retry_policy_max_attempts, options.retry_policy_initial_backoff, + options.retry_policy_max_backoff, options.retry_policy_backoff_multiplier); if (!async_mode) { otlp_http_client_options.max_concurrent_requests = 0;