Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/integration/configurations/nighthawk_http_origin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static_resources:
domains:
- "*"
http_filters:
- name: time-tracking
- name: dynamic-delay
- name: test-server
config:
Expand Down
13 changes: 9 additions & 4 deletions test/integration/test_integration_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,11 @@ def test_cli_output_format(http_test_server_fixture):
asserts.assertIn("Percentile", output)


def test_request_body_gets_transmitted(http_test_server_fixture):
"""Test request body transmission.
@pytest.mark.parametrize(
'filter_configs',
["{}", "{static_delay: \"0.01s\"}", "{emit_previous_request_delta_in_response_header: \"aa\"}"])
def test_request_body_gets_transmitted(http_test_server_fixture, filter_configs):
"""Test request body transmission handling code for our extensions.

Ensure that the number of bytes we request for the request body gets reflected in the upstream
connection transmitted bytes counter for h1 and h2.
Expand All @@ -433,14 +436,16 @@ def check_upload_expectations(fixture, parsed_json, expected_transmitted_bytes,
"http.ingress_http.downstream_cx_rx_bytes_total"),
expected_received_bytes)

upload_bytes = 1024 * 1024 * 3
# TODO(#531): The dynamic-delay extension hangs unless we lower the request entity body size.
upload_bytes = 1024 * 1024 if "static_delay" in filter_configs else 1024 * 1024 * 3
requests = 10
args = [
http_test_server_fixture.getTestServerRootUri(), "--duration", "100", "--rps", "100",
"--request-body-size",
str(upload_bytes), "--termination-predicate",
"benchmark.http_2xx:%s" % str(requests), "--connections", "1", "--request-method", "POST",
"--max-active-requests", "1"
"--max-active-requests", "1", "--request-header",
"x-nighthawk-test-server-config:%s" % filter_configs
]
# Test we transmit the expected amount of bytes with H1
parsed_json, _ = http_test_server_fixture.runNighthawkClient(args)
Expand Down