diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-12-07 08:19:30 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-12-08 04:21:29 +0300 |
commit | d7c9431546fc48a02f1e176b2ac21a6c8927542c (patch) | |
tree | 3d595a00a9fb4a257d21ee5425354995fc9a6434 /test/acceptance/helpers_test.go | |
parent | c57f28159a32b325ec54f190b0f13c4676600d42 (diff) |
test: add slow req acceptance test
Diffstat (limited to 'test/acceptance/helpers_test.go')
-rw-r--r-- | test/acceptance/helpers_test.go | 5 |
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) |