Commit bf2882e
committed
test: add streaming DSL and fix receive race
Introduces a robust testing DSL for gRPC streaming scenarios and fixes a
concurrency bug in the legacy test utilities.
Key Improvements:
- **DSL:** Adds high-level request builders (`ReqLLM`, `ReqRaw`) to
create readable, intent-based test cases.
- **Race Fix:** Refactors `StreamedRequest` to use a serial read loop.
Previously, concurrent `Recv()` calls caused undefined behavior that
masked server responses.
- **Robustness:** Updates `GetFreePort` to prevent race conditions
during parallel test execution.
**Note on EPP Tests:**
The race condition fix in `StreamedRequest` stabilized the test output,
revealing an incorrect assertion in
`test/integration/epp/hermetic_test.go`. The server correctly returns a
generic 400 error without echoing the invalid body (security best
practice), but the test expected the body to be echo'd. The assertion
has been updated to match the correct, stable server behavior.1 parent 56e6721 commit bf2882e
2 files changed
+278
-112
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
807 | | - | |
| 807 | + | |
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| |||
0 commit comments