Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP: Warning and test fix #943

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion plugins/http_plugin/tests/unit_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ BOOST_FIXTURE_TEST_CASE(bytes_in_flight, http_plugin_test_fixture) {
};

auto wait_for_no_bytes_in_flight = [&](uint16_t max = std::numeric_limits<uint16_t>::max()) {
greg7mdp marked this conversation as resolved.
Show resolved Hide resolved
while (http_plugin->bytes_in_flight() > 0 && http_plugin->requests_in_flight() > 0 && --max)
Copy link
Contributor

@greg7mdp greg7mdp Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this shouldn't make a difference as they should either both be 0 or both non-zero.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by that too. And I don't understand the discrepancy why wait_for_no_bytes_in_flight looks at both while wait_for_no_requests_in_flight looks at only one. If the intent is to look at both then a common wait_for_nothing_in_flight could be made that looks at both.

while ((http_plugin->bytes_in_flight() > 0 || http_plugin->requests_in_flight() > 0) && --max)
std::this_thread::sleep_for(std::chrono::milliseconds(5));
BOOST_CHECK(max > 0);
};
Expand Down