Skip to content

Commit

Permalink
Use Transport.ResponseHeaderTimeout to set pelican.timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiemstrawisc committed Nov 21, 2024
1 parent 9eeefdb commit e94151e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions local_cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,12 @@ func TestLargeFile(t *testing.T) {

clientConfig := map[string]interface{}{
"Client.MaximumDownloadSpeed": 40 * 1024 * 1024,
"Transport.ResponseHeaderTimeout": "1000s",
}
test_utils.InitClient(t, clientConfig)
ft := fed_test_utils.NewFedTest(t, pubOriginCfg)

// Set a custom timeout for this test to see if we can make it less flaky
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
ctx, cancelTest, egrp := test_utils.TestContext(ctx, t)

ctx, cancel, egrp := test_utils.TestContext(context.Background(), t)
te, err := client.NewTransferEngine(ctx)
require.NoError(t, err)

Expand All @@ -397,7 +395,7 @@ func TestLargeFile(t *testing.T) {
size := test_utils.WriteBigBuffer(t, fp, 100)

require.NoError(t, err)
tr, err := client.DoGet(ctx, "pelican://"+param.Server_Hostname.GetString()+":"+strconv.Itoa(param.Server_WebPort.GetInt())+"/test/hello_world.txt?pelican.timeout=600s",
tr, err := client.DoGet(ctx, "pelican://"+param.Server_Hostname.GetString()+":"+strconv.Itoa(param.Server_WebPort.GetInt())+"/test/hello_world.txt",
filepath.Join(tmpDir, "hello_world.txt"), false, client.WithCaches(cacheUrl))
assert.NoError(t, err)
require.Equal(t, 1, len(tr))
Expand All @@ -406,7 +404,6 @@ func TestLargeFile(t *testing.T) {

t.Cleanup(func() {
cancel()
cancelTest()
if err := egrp.Wait(); err != nil && err != context.Canceled && err != http.ErrServerClosed {
require.NoError(t, err)
}
Expand Down

0 comments on commit e94151e

Please sign in to comment.