Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint issues #4

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ func (r *Runner) newVU(idLocal, idGlobal uint64, samplesOut chan<- stats.SampleC
}

if forceHTTP1() {
transport.TLSNextProto = make(map[string]func(string, *tls.Conn) http.RoundTripper) //send over h1 protocol
transport.TLSNextProto = make(map[string]func(string, *tls.Conn) http.RoundTripper) // send over h1 protocol
} else {
_ = http2.ConfigureTransport(transport) //send over h2 protocol
_ = http2.ConfigureTransport(transport) // send over h2 protocol
}

cookieJar, err := cookiejar.New(nil)
Expand Down
25 changes: 18 additions & 7 deletions js/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2075,9 +2075,12 @@ func TestMinIterationDurationIsCancellable(t *testing.T) {
}

func TestForceHTTP1FeatureEnabledCheckForH1(t *testing.T) {
os.Setenv("GODEBUG", "http2client=0,gctrace=1")

defer os.Unsetenv("GODEBUG")
err := os.Setenv("GODEBUG", "http2client=0,gctrace=1")
require.NoError(t, err)
defer func() {
err := os.Unsetenv("GODEBUG")
require.NoError(t, err)
}()

assert.True(t, forceHTTP1())

Expand All @@ -2100,9 +2103,11 @@ func TestForceHTTP1FeatureEnabledCheckForH1(t *testing.T) {
`)
require.NoError(t, err)

r1.SetOptions(lib.Options{
err = r1.SetOptions(lib.Options{
InsecureSkipTLSVerify: null.BoolFrom(true),
})
require.NoError(t, err)


registry := metrics.NewRegistry()
builtinMetrics := metrics.RegisterBuiltinMetrics(registry)
Expand All @@ -2126,8 +2131,12 @@ func TestForceHTTP1FeatureEnabledCheckForH1(t *testing.T) {
}

func TestForceHTTP1FeatureDisabledCheckForH2(t *testing.T) {
os.Setenv("GODEBUG", "test=0")
defer os.Unsetenv("GODEBUG")
err := os.Setenv("GODEBUG", "test=0")
require.NoError(t, err)
defer func() {
err := os.Unsetenv("GODEBUG")
require.NoError(t, err)
}()

assert.False(t, forceHTTP1())

Expand All @@ -2150,10 +2159,12 @@ func TestForceHTTP1FeatureDisabledCheckForH2(t *testing.T) {
`)
require.NoError(t, err)

r1.SetOptions(lib.Options{
err = r1.SetOptions(lib.Options{
InsecureSkipTLSVerify: null.BoolFrom(true),
})

require.NoError(t, err)

registry := metrics.NewRegistry()
builtinMetrics := metrics.RegisterBuiltinMetrics(registry)
r2, err := NewFromArchive(testutils.NewLogger(t), r1.MakeArchive(), lib.RuntimeOptions{}, builtinMetrics, registry)
Expand Down