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 'internal/httprange/http_ranged_reader_test.go')
-rw-r--r--internal/httprange/http_ranged_reader_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/httprange/http_ranged_reader_test.go b/internal/httprange/http_ranged_reader_test.go
index b17d06b1..d32e5619 100644
--- a/internal/httprange/http_ranged_reader_test.go
+++ b/internal/httprange/http_ranged_reader_test.go
@@ -18,6 +18,10 @@ const (
testDataLen = len(testData)
)
+var testClient = &http.Client{
+ Timeout: 100 * time.Millisecond,
+}
+
func TestSectionReader(t *testing.T) {
tests := map[string]struct {
sectionOffset int
@@ -80,7 +84,7 @@ func TestSectionReader(t *testing.T) {
testServer := newTestServer(t, nil)
defer testServer.Close()
- resource, err := NewResource(context.Background(), testServer.URL+"/resource")
+ resource, err := NewResource(context.Background(), testServer.URL+"/resource", testClient)
require.NoError(t, err)
for name, tt := range tests {
@@ -163,7 +167,7 @@ func TestReadAt(t *testing.T) {
testServer := newTestServer(t, nil)
defer testServer.Close()
- resource, err := NewResource(context.Background(), testServer.URL+"/resource")
+ resource, err := NewResource(context.Background(), testServer.URL+"/resource", testClient)
require.NoError(t, err)
for name, tt := range tests {
@@ -202,7 +206,7 @@ func TestReadAtMultipart(t *testing.T) {
})
defer testServer.Close()
- resource, err := NewResource(context.Background(), testServer.URL+"/resource")
+ resource, err := NewResource(context.Background(), testServer.URL+"/resource", testClient)
require.NoError(t, err)
require.Equal(t, int32(1), counter)
@@ -247,7 +251,7 @@ func TestReadContextCanceled(t *testing.T) {
testServer := newTestServer(t, nil)
defer testServer.Close()
- resource, err := NewResource(context.Background(), testServer.URL+"/resource")
+ resource, err := NewResource(context.Background(), testServer.URL+"/resource", testClient)
require.NoError(t, err)
rr := NewRangedReader(resource)