From 44c9c4920dc69fbea6a2c0f597c3abdaef35c854 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Sun, 31 Oct 2021 18:00:25 +0800 Subject: [PATCH] fix: connection keep alive --- runner.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/runner.go b/runner.go index 8fc15893..c56d0b8c 100644 --- a/runner.go +++ b/runner.go @@ -12,6 +12,7 @@ import ( "strconv" "strings" "testing" + "time" "github.com/pkg/errors" ) @@ -23,9 +24,14 @@ func Run(t *testing.T, testcases ...ITestCase) error { func NewRunner() *Runner { return &Runner{ - t: &testing.T{}, - debug: false, // default to turn off debug - client: &http.Client{}, + t: &testing.T{}, + debug: false, // default to turn off debug + client: &http.Client{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + }, + Timeout: 30 * time.Second, + }, } }