test: Use timeout_factor for drain timeout in check_slow_read_throttle #36450

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2610-test-check_slow_read_throttle-http-timeout-fix changing 1 files +2 −2
  1. maflcko commented at 9:44 AM on October 7, 2026: member

    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
    
  2. test: Use timeout_factor for drain timeout in check_slow_read_throttle fa845f76d5
  3. DrahtBot added the label Tests on Oct 7, 2026
  4. DrahtBot commented at 9:44 AM on October 7, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK pinheadmz, l0rinc

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. sedited requested review from pinheadmz on Oct 7, 2026
  6. pinheadmz commented at 2:05 PM on October 7, 2026: member

    untested, LGTM ACK fa845f76d5c6d9c4aba46e03eb9b77a6e1f5ddce

  7. l0rinc commented at 12:50 AM on October 8, 2026: contributor

    code review ACK fa845f76d5c6d9c4aba46e03eb9b77a6e1f5ddce

  8. sedited merged this on Oct 8, 2026
  9. sedited closed this on Oct 8, 2026

  10. maflcko deleted the branch on Oct 8, 2026


pinheadmz

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-10-08 23:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me