[nginx-tests] Tests: improved h2_priority.t.

Maxim Dounin mdounin at mdounin.ru
Wed Jul 23 18:55:12 UTC 2025


details:   http://freenginx.org/hg/nginx-tests/rev/0f089661084d
branches:  
changeset: 2014:0f089661084d
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sat Jul 19 05:25:14 2025 +0300
description:
Tests: improved h2_priority.t.

Tests in h2_priority.t do not tolerate extra data being split over multiple
HTTP/2 frames, yet this can happen if writing to the socket buffer blocks
and then a small amount of data (1 byte) remains in the HTTP/2 connection
queue due to flow control: when the window is opened again, this 1 byte
will be sent in a separate frame, and the remaining bytes will be read and
sent afterwards.

Failures due to this issue were observed during testing on OpenBSD, and
might be easily reproduced on other platforms with small enough socket
buffers.

Fix is to use output_buffers large enough to read the full response, so the
remaining bytes are always sent in a single HTTP/2 frame.

diffstat:

 h2_priority.t |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff --git a/h2_priority.t b/h2_priority.t
--- a/h2_priority.t
+++ b/h2_priority.t
@@ -40,6 +40,7 @@ http {
         listen       127.0.0.1:8080;
         server_name  localhost;
         http2 on;
+        output_buffers 3 32k;
     }
 }
 


More information about the nginx-devel mailing list