-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
close #46011
- Loading branch information
1 parent
9d45b51
commit 8f68518
Showing
5 changed files
with
65 additions
and
3 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,26 @@ | ||
// Copyright 2022 PingCAP, Inc. Licensed under Apache-2.0. | ||
|
||
package storage_test | ||
|
||
import ( | ||
"net/http" | ||
"testing" | ||
|
||
"github.com/pingcap/tidb/br/pkg/storage" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestDefaultHttpTransport(t *testing.T) { | ||
transport, ok := storage.CloneDefaultHttpTransport() | ||
require.True(t, ok) | ||
require.True(t, transport.MaxConnsPerHost == 0) | ||
require.True(t, transport.MaxIdleConns > 0) | ||
} | ||
|
||
func TestDefaultHttpClient(t *testing.T) { | ||
var concurrency uint = 128 | ||
transport, ok := storage.GetDefaultHttpClient(concurrency).Transport.(*http.Transport) | ||
require.True(t, ok) | ||
require.Equal(t, int(concurrency), transport.MaxIdleConnsPerHost) | ||
require.Equal(t, int(concurrency), transport.MaxIdleConns) | ||
} |
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