test: optimize waitForNextUpstreamRequest()#11026
test: optimize waitForNextUpstreamRequest()#11026alyssawilk merged 3 commits intoenvoyproxy:masterfrom
Conversation
//test/integration:protocol_integration_test After: Stats over 50 runs: max = 11.8s, min = 1.2s, avg = 4.0s, dev = 4.3s Before: Stats over 50 runs: max = 2.6s, min = 1.4s, avg = 2.4s, dev = 0.3s Signed-off-by: Yuchen Dai <silentdai@gmail.com>
|
|
||
| AssertionResult result = AssertionFailure(); | ||
| for (auto upstream_index : upstream_indices) { | ||
| int upstream_index = 0; |
There was a problem hiding this comment.
I wonder if the test failures are related to the fact that the original only tests upstreams with the given indices, while your version always checks all upstreams? Also, the original is much more likely to return the first member of upstream_indices with a request than the optimized version.
There was a problem hiding this comment.
Thanks! I think you are right. I should iterate over the indexes which is passed. An embarrassing mistake.
zuercher
left a comment
There was a problem hiding this comment.
Thanks. This seems reasonable to me. Tagging in Alyssa to see what she thinks.
alyssawilk
left a comment
There was a problem hiding this comment.
That's a great catch, and a nice speed up!
Super minor comment nit both otherwise LGTM!
test/integration/http_integration.cc
Outdated
| int upstream_index = 0; | ||
| Event::TestTimeSystem& time_system = timeSystem(); | ||
| auto end_time = time_system.monotonicTime() + connection_wait_timeout; | ||
| // Loop over the upstreams until timeout or get a upstream request. |
There was a problem hiding this comment.
rephrase?
Loop over the upstreams until the call times out or an upstream request is received.
Commit Message: //test/integration:protocol_integration_test After: Stats over 50 runs: max = 11.8s, min = 1.2s, avg = 4.0s, dev = 4.3s Before: Stats over 50 runs: max = 2.6s, min = 1.4s, avg = 2.4s, dev = 0.3s Signed-off-by: Yuchen Dai silentdai@gmail.com Additional Description: Risk Level: LOW Testing: test Docs Changes: n/a Release Notes: n/a Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Commit Message: //test/integration:protocol_integration_test After: Stats over 50 runs: max = 11.8s, min = 1.2s, avg = 4.0s, dev = 4.3s Before: Stats over 50 runs: max = 2.6s, min = 1.4s, avg = 2.4s, dev = 0.3s Signed-off-by: Yuchen Dai silentdai@gmail.com Additional Description: Risk Level: LOW Testing: test Docs Changes: n/a Release Notes: n/a Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Commit Message:
//test/integration:protocol_integration_test
After:
Stats over 50 runs: max = 11.8s, min = 1.2s, avg = 4.0s, dev = 4.3s
Before:
Stats over 50 runs: max = 2.6s, min = 1.4s, avg = 2.4s, dev = 0.3s
Signed-off-by: Yuchen Dai silentdai@gmail.com
Additional Description:
Risk Level: LOW
Testing: test
Docs Changes: n/a
Release Notes: n/a