Skip to content

Conversation

azkrishpy
Copy link
Contributor

Issue #, if available:

Description of changes:
changes to HTTP2 mock server, added HTTP/1.1 mock server. Changed some testcases to reflect mock server changes.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment on lines 32 to 37
result = self.env.shell.exec(python_path,
'-m', 'pip', 'install', 'h11')
result = self.env.shell.exec(python_path,
'-m', 'pip', 'install', 'trio')
result = self.env.shell.exec(python_path,
'-m', 'pip', 'install', 'h2')
Copy link
Contributor

Choose a reason for hiding this comment

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

super trivial: we can install the deps together in one cmd.

Suggested change
result = self.env.shell.exec(python_path,
'-m', 'pip', 'install', 'h11')
result = self.env.shell.exec(python_path,
'-m', 'pip', 'install', 'trio')
result = self.env.shell.exec(python_path,
'-m', 'pip', 'install', 'h2')
result = self.env.shell.exec(python_path, '-m', 'pip', 'install', 'h2', 'h11', 'trio', check=True)

* Have the cert/key ready. The script now using `../resources/unittests.crt`, you can either just run the script within this directory, which will find the certificates and key from the related path, or you can use your own and change the code coordinately.
* Run python. `python3 ./server.py`.

#### Endpoints
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we missed x-upload-test?

Also, I think the endpoint is misleading, they are not different endpoints.

Comment on lines 398 to 403
const char *bytes_key = "\"bytes\": ";
const char *json_str = (const char *)data->ptr;
const char *bytes_pos = strstr(json_str, bytes_key);
if (bytes_pos != NULL) {
s_tester.num_sen_received = (uint64_t)strtoull(bytes_pos + strlen(bytes_key), NULL, 10);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably fine in test, but we are trying to not use str directly in the codebase, we have helpers in byte_buf.h and string.h in common.

curl -k -v -H "x-repeat-data: 5000000" -H "x-slow-response: true" -H "x-throughput-bps: 500" https://localhost:3443/echo
```

##### Any other path
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you merge the current main? I think I just added a expect-500 to the mock server a day or two ago, we will also want to add it here

@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.70%. Comparing base (e638eb0) to head (420b348).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #534   +/-   ##
=======================================
  Coverage   79.70%   79.70%           
=======================================
  Files          28       28           
  Lines       11865    11865           
=======================================
  Hits         9457     9457           
  Misses       2408     2408           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@azkrishpy azkrishpy marked this pull request as ready for review October 23, 2025 00:09
@azkrishpy azkrishpy merged commit e5999fb into main Oct 23, 2025
44 of 45 checks passed
@azkrishpy azkrishpy deleted the update-mock-server branch October 23, 2025 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants