The check_slow_read_throttle functional test may intermittently fail on slow build configs (like sanitizers+debug+no-opt). This is fine, but it would be nice if it passed.
To reproduce the failure, add a long sleep for the big json requests:
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 0c25ebbba5..42c54c2cdf 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -614,2 +614,3 @@ void HTTPRemoteClient::Send(const HTTPResponse& res, std::span<const std::byte>
bool send_buffer_was_empty{false};
+ bool send_buffer_over_limit{false};
// Fill the send buffer with the complete serialized response headers + body
@@ -634,2 +635,4 @@ void HTTPRemoteClient::Send(const HTTPResponse& res, std::span<const std::byte>
if (!send_buffer_was_empty) m_send_ready = true;
+
+ send_buffer_over_limit = m_send_buffer.size() > MAX_BODY_SIZE;
}
@@ -652,2 +655,11 @@ void HTTPRemoteClient::Send(const HTTPResponse& res, std::span<const std::byte>
+ // TEST-ONLY: Widen the interval between queueing a throttling-sized response
+ // and allowing the next pipelined request to be dispatched. This reproduces
+ // the slow-worker scheduling window exercised by interface_http.py.
+ if (send_buffer_over_limit) {
+ // The functional test waits twice for five seconds before it starts
+ // its own ten-second recv() timeout, so this must cover both phases.
+ std::this_thread::sleep_for(30s);
+ }
+
// Signal to the I/O loop that we are ready to handle the next request.
Then, on master (or on this pull with --timeout-factor=1), it will fail and with --timeout-factor=3 it will pass:
./bld-cmake/test/functional/interface_http.py --test_methods check_slow_read_throttle --loglevel=DEBUG --timeout-factor 3