Skip to content

Commit

Permalink
Make http.TestErrorCodes pass on GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Oct 12, 2020
1 parent 086b428 commit a6963bd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions js/modules/k6/http/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1641,8 +1641,6 @@ func checkErrorCode(t testing.TB, tags *stats.SampleTags, code int, msg string)
}

func TestErrorCodes(t *testing.T) {
// lookup dafsgdhfjg on 127.0.0.53:53: server misbehaving
t.Skip("fails on gh-actions")
t.Parallel()
tb, state, samples, rt, _ := newRuntime(t)
state.Options.Throw = null.BoolFrom(false)
Expand Down Expand Up @@ -1671,7 +1669,7 @@ func TestErrorCodes(t *testing.T) {
name: "Unroutable",
expectedErrorCode: 1101,
expectedErrorMsg: "lookup: no such host",
script: `var res = http.request("GET", "http://sdafsgdhfjg/");`,
script: `var res = http.request("GET", "http://sdafsgdhfjg.com/");`,
},

{
Expand All @@ -1685,7 +1683,7 @@ func TestErrorCodes(t *testing.T) {
expectedErrorCode: 1101,
expectedErrorMsg: "lookup: no such host",
moreSamples: 1,
script: `var res = http.request("GET", "HTTPBIN_URL/redirect-to?url=http://dafsgdhfjg/");`,
script: `var res = http.request("GET", "HTTPBIN_URL/redirect-to?url=http://dafsgdhfjg.com/");`,
},
{
name: "Non location redirect",
Expand All @@ -1703,7 +1701,7 @@ func TestErrorCodes(t *testing.T) {
name: "Missing protocol",
expectedErrorCode: 1000,
expectedErrorMsg: `unsupported protocol scheme ""`,
script: `var res = http.request("GET", "dafsgdhfjg/");`,
script: `var res = http.request("GET", "dafsgdhfjg.com/");`,
},
{
name: "Too many redirects",
Expand Down

0 comments on commit a6963bd

Please sign in to comment.