From 5c5b2b25b701d91f0c0ebaf3be95eed7a4fcaacd Mon Sep 17 00:00:00 2001 From: Yosry Ahmed Date: Tue, 1 Sep 2020 16:22:55 -0700 Subject: [PATCH 1/3] Documented a common integration tests problem when content-length does not match the actual body length Signed-off-by: Yosry Ahmed --- test/integration/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/README.md b/test/integration/README.md index d3cffc3d5412c..1b06bf3e263a9 100644 --- a/test/integration/README.md +++ b/test/integration/README.md @@ -99,6 +99,9 @@ cluster: In addition to the existing test framework, which allows for carefully timed interaction and ordering of events between downstream, Envoy, and Upstream, there is now an “autonomous” framework which simplifies the common case where the timing is not essential (or bidirectional streaming is desired). When AutonomousUpstream is used, by setting `autonomous_upstream_ = true` before `initialize()`, upstream will by default create AutonomousHttpConnections for each incoming connection and AutonomousStreams for each incoming stream. By default, the streams will respond to each complete request with “200 OK” and 10 bytes of payload, but this behavior can be altered by setting various request headers, as documented in [`autonomous_upstream.h`](autonomous_upstream.h) +## Common Problems +- If a response body length does not match the `content-length` header (or there is no header at all), any mock calls to wait for the response completion such as `sendRequestAndWaitForResponse` or `response_->waitForEndStream` could timeout. Also, any asserts that the response was completed such as `EXPECT_TRUE(response_->complete())` would fail. Make sure that the response body length matches the `content-length` header. + # Extending the test framework The Envoy integration test framework is most definitely a work in progress. From cecb2c75a24f4deb0ad51d07a771aa99be50f93b Mon Sep 17 00:00:00 2001 From: Yosry Ahmed Date: Wed, 2 Sep 2020 18:29:56 +0000 Subject: [PATCH 2/3] Spelling fix Signed-off-by: Yosry Ahmed --- test/integration/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/README.md b/test/integration/README.md index 1b06bf3e263a9..4a055b0bfa47c 100644 --- a/test/integration/README.md +++ b/test/integration/README.md @@ -100,7 +100,7 @@ cluster: In addition to the existing test framework, which allows for carefully timed interaction and ordering of events between downstream, Envoy, and Upstream, there is now an “autonomous” framework which simplifies the common case where the timing is not essential (or bidirectional streaming is desired). When AutonomousUpstream is used, by setting `autonomous_upstream_ = true` before `initialize()`, upstream will by default create AutonomousHttpConnections for each incoming connection and AutonomousStreams for each incoming stream. By default, the streams will respond to each complete request with “200 OK” and 10 bytes of payload, but this behavior can be altered by setting various request headers, as documented in [`autonomous_upstream.h`](autonomous_upstream.h) ## Common Problems -- If a response body length does not match the `content-length` header (or there is no header at all), any mock calls to wait for the response completion such as `sendRequestAndWaitForResponse` or `response_->waitForEndStream` could timeout. Also, any asserts that the response was completed such as `EXPECT_TRUE(response_->complete())` would fail. Make sure that the response body length matches the `content-length` header. +- If a response body length does not match the `content-length` header (or there is no header at all), any mock calls to wait for the response completion such as `sendRequestAndWaitForResponse` or `response_->waitForEndStream` could time out. Also, any asserts that the response was completed such as `EXPECT_TRUE(response_->complete())` could fail. Make sure that the response body length matches the `content-length` header. # Extending the test framework From 1b568199c8eba4911ee618270b78dcae28cfe847 Mon Sep 17 00:00:00 2001 From: Yosry Ahmed Date: Tue, 8 Sep 2020 18:59:14 +0000 Subject: [PATCH 3/3] Removed the missing header part Signed-off-by: Yosry Ahmed --- test/integration/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/README.md b/test/integration/README.md index 4a055b0bfa47c..7b754e77ee3cd 100644 --- a/test/integration/README.md +++ b/test/integration/README.md @@ -100,7 +100,7 @@ cluster: In addition to the existing test framework, which allows for carefully timed interaction and ordering of events between downstream, Envoy, and Upstream, there is now an “autonomous” framework which simplifies the common case where the timing is not essential (or bidirectional streaming is desired). When AutonomousUpstream is used, by setting `autonomous_upstream_ = true` before `initialize()`, upstream will by default create AutonomousHttpConnections for each incoming connection and AutonomousStreams for each incoming stream. By default, the streams will respond to each complete request with “200 OK” and 10 bytes of payload, but this behavior can be altered by setting various request headers, as documented in [`autonomous_upstream.h`](autonomous_upstream.h) ## Common Problems -- If a response body length does not match the `content-length` header (or there is no header at all), any mock calls to wait for the response completion such as `sendRequestAndWaitForResponse` or `response_->waitForEndStream` could time out. Also, any asserts that the response was completed such as `EXPECT_TRUE(response_->complete())` could fail. Make sure that the response body length matches the `content-length` header. +- If a response body length does not match the `content-length` header, any mock calls to wait for the response completion such as `sendRequestAndWaitForResponse` or `response_->waitForEndStream` could time out. Also, any asserts that the response was completed such as `EXPECT_TRUE(response_->complete())` could fail. Make sure that the response body length matches the `content-length` header. # Extending the test framework