feat: add SSE and HTTP streaming support#4014
Conversation
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
…noise configuration handling. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
…ervice for SSE support. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
…update replay service logic. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
…ing the mock window and refine outgoing message recording logs. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
…le replay Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
- Added a new function to merge consecutive SSE data fields, allowing for proper handling of multiline data. - Updated the `compareSSEFields` function to utilize the new merging logic. - Introduced tests to validate the normalization of multiline SSE data in both parsing and serialization contexts. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> Signed-off-by: Asish Kumar <87874775+officialasishkumar@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> Signed-off-by: Asish Kumar <87874775+officialasishkumar@users.noreply.github.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
…son logic for HTTP. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
pkg/service/orchestrator/rerecord.go:484
rerecordstill simulates SSE/streaming testcases viapkg.SimulateHTTP, which reads the full response body. For SSE/long-lived HTTP streams this can block until timeout and prevent rerecord from completing/capturing the stream body. Route streaming testcases throughpkg.SimulateHTTPStreamingand capture/close the stream using the new streaming comparators/stream-body model (similar to replay’s streaming path) so rerecord works reliably for SSE/HTTP streaming.
hostToUse := o.config.Test.Host
configPortToUse := o.config.ReRecord.Port
if isSSERequest && o.config.ReRecord.SSEPort > 0 {
configPortToUse = o.config.ReRecord.SSEPort
}
resp, err := pkg.SimulateHTTP(ctx, tc, testSet, o.logger, pkg.SimulationConfig{
APITimeout: o.config.Test.APITimeout,
ConfigPort: configPortToUse,
KeployPath: o.config.Path,
ConfigHost: hostToUse,
URLReplacements: nil,
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The index field in streamingTest was set but never read. Removed the field and the corresponding idx loop variable to eliminate dead code. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Switched from p.logger to the contextual logger in the outgoing record path so connection-level fields (IDs, destination) are included in the debug and error logs consistently. Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 1 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
83d236d to
6ffa015
Compare
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
Describe the changes that are made
ssePort, protocol-level port configuration, andreplaceWithport mapping so replay and rerecord can route streaming traffic correctlyLinks & References
Closes: #3811
🔗 Related PRs
🐞 Related Issues
📄 Related Documents
What type of PR is this? (check all applicable)
Added e2e test pipeline?
Added comments for hard-to-understand areas?
Added to documentation?
Are there any sample code or steps to test the changes?
Sample steps to test
keploy test --port 8000 --sse-port 8047 --api-timeout 200 --delay 30for the SSE flow covered by the workflow.github/workflows/test_workflow_scripts/golang/sse_preflight/golang-linux.shSelf Review done?
Any relevant screenshots, recordings or logs?
🧠 Semantics for PR Title & Branch Name
Please ensure your PR title and branch name follow the Keploy semantics:
📌 PR Semantics Guide
📌 Branch Semantics Guide
Examples:
fix: patch MongoDB document update bugfeat/#1-login-flow(You may skip mentioning the issue number in the branch name if the change is small and the PR description clearly explains it.)Additional checklist: