Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 10 additions & 3 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 with.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this comment is incomplete?


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 @@ -434,13 +437,17 @@ def check_upload_expectations(fixture, parsed_json, expected_transmitted_bytes,
expected_received_bytes)

upload_bytes = 1024 * 1024 * 3
# TODO(#531): The dynamic-delay extension hangs unless we lower the request entity body size.
if "static_delay" in filter_configs:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How do you feel about combining this with the above line and making it a ternary, rather than an if condition?

My 2 cents is that as is, it's possible to scan this and not notice that upload_bytes has changed from its original value.

upload_bytes = int(upload_bytes / 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