Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored Dec 17, 2024
1 parent a16b6ec commit 98e926b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class HttpClient : public opentelemetry::ext::http::client::HttpClient
std::chrono::milliseconds scheduled_delay_milliseconds_;

std::chrono::milliseconds background_thread_wait_for_;
std::atomic<bool> is_shutdown_;
std::atomic<bool> is_shutdown_{false};

nostd::shared_ptr<HttpCurlGlobalInitializer> curl_global_initializer_;
};
Expand Down
6 changes: 3 additions & 3 deletions ext/test/http/curl_http_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ TEST_F(BasicCurlHttpTests, ElegantQuitQuick)
auto beg = std::chrono::system_clock::now();
http_client->FinishAllSessions();
http_client.reset();
// when use background_thread_wait_for_ should have no side effort on elegant quit
// it shoule less than scheduled_delay_milliseconds_
// because ci machine may slow, some take 10ms, so we assert it less than 20ms
// when background_thread_wait_for_ is used, it should have no side effect on elegant quit
// wait should be less than scheduled_delay_milliseconds_
// Due to load on CI hosts (some take 10ms), we assert it is less than 20ms
auto cost = std::chrono::system_clock::now() - beg;
ASSERT_TRUE(cost < std::chrono::milliseconds{20})
<< "cost ms: " << std::chrono::duration_cast<std::chrono::milliseconds>(cost).count()
Expand Down

0 comments on commit 98e926b

Please sign in to comment.