Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/acceptance/helpers_test.go')
-rw-r--r--test/acceptance/helpers_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/acceptance/helpers_test.go b/test/acceptance/helpers_test.go
index ce2d47d3..769b0467 100644
--- a/test/acceptance/helpers_test.go
+++ b/test/acceptance/helpers_test.go
@@ -449,6 +449,7 @@ type stubOpts struct {
pagesHandler http.HandlerFunc
pagesStatusResponse int
pagesRoot string
+ delay time.Duration
}
func NewGitlabDomainsSourceStub(t *testing.T, opts *stubOpts) *httptest.Server {
@@ -529,6 +530,10 @@ func defaultAPIHandler(t *testing.T, opts *stubOpts) http.HandlerFunc {
w.WriteHeader(http.StatusNoContent)
return
}
+ // to test slow responses from the API
+ if opts.delay > 0 {
+ time.Sleep(opts.delay)
+ }
opts.setAPICalled(true)