Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Acceptance test for large HTTP responses
Check that requests don't hang when the HTTP response is large (up to 200kB). This should prevent regressions of the MTU problem described in the preceding commit.
- Loading branch information
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package acceptance_test | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
. "github.com/onsi/gomega/gexec" | ||
|
||
"github.com/cloudfoundry-incubator/cf-test-helpers/cf" | ||
"github.com/cloudfoundry-incubator/cf-test-helpers/generator" | ||
"github.com/cloudfoundry-incubator/cf-test-helpers/helpers" | ||
) | ||
|
||
var _ = Describe("Apps response size", func() { | ||
var appName string | ||
|
||
BeforeEach(func() { | ||
appName = generator.PrefixedRandomName("CATS-APP-DORA-") | ||
Expect(cf.Cf( | ||
"push", appName, | ||
"-b", config.RubyBuildpackName, | ||
"-p", "../../../../cf-release/src/github.com/cloudfoundry/cf-acceptance-tests/assets/dora", | ||
"-d", config.AppsDomain, | ||
"-i", "1", | ||
"-m", "256M", | ||
).Wait(CF_PUSH_TIMEOUT)).To(Exit(0)) | ||
}) | ||
|
||
It("should serve request and response bodies of increasing sizes", func() { | ||
for responsekB := 1; responsekB <= 200; responsekB += 10 { | ||
By(fmt.Sprintf("response size of %d kB", responsekB)) | ||
response := helpers.CurlAppWithTimeout( | ||
appName, | ||
fmt.Sprintf("/largetext/%d", responsekB), | ||
5*time.Second, | ||
) | ||
Expect(response).To(HaveLen(responsekB * int(KILOBYTE))) | ||
} | ||
}) | ||
}) |