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

ci: fix nightly tests #157

Merged
merged 2 commits into from
Feb 5, 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
23 changes: 18 additions & 5 deletions rpc/jsonrpc/client/http_json_client_test.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
package client

import (
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"testing"

"github.com/stretchr/testify/require"
)

func TestHTTPClientMakeHTTPDialer(t *testing.T) {
remote := []string{"https://foo-bar.com:80", "http://foo-bar.net:80", "https://user:pass@foo-bar.net:80"}
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte("Hi!\n"))
})
ts := httptest.NewServer(handler)
defer ts.Close()

for _, f := range remote {
u, err := newParsedURL(f)
tsTLS := httptest.NewTLSServer(handler)
defer tsTLS.Close()
// This silences a TLS handshake error, caused by the dialer just immediately
// disconnecting, which we can just ignore.
tsTLS.Config.ErrorLog = log.New(ioutil.Discard, "", 0)

for _, testURL := range []string{ts.URL, tsTLS.URL} {
u, err := newParsedURL(testURL)
require.NoError(t, err)
dialFn, err := makeHTTPDialer(f)
dialFn, err := makeHTTPDialer(testURL)
require.Nil(t, err)

addr, err := dialFn(u.Scheme, u.GetHostWithPath())
require.NoError(t, err)
require.NotNil(t, addr)
}

}
4 changes: 2 additions & 2 deletions test/e2e/generator/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ var (

// The following specify randomly chosen values for testnet nodes.
nodeDatabases = uniformChoice{"goleveldb", "cleveldb", "rocksdb", "boltdb", "badgerdb"}
nodeABCIProtocols = uniformChoice{"unix", "tcp", "grpc", "builtin"}
nodeABCIProtocols = uniformChoice{"unix", "tcp", "builtin"} // don't run with grpc
nodePrivvalProtocols = uniformChoice{"file", "unix", "tcp"}
nodeFastSyncs = uniformChoice{"", "v0", "v2"}
nodeFastSyncs = uniformChoice{"", "v0"} // disable v2 due to bugs
nodeStateSyncs = uniformChoice{false, true}
nodePersistIntervals = uniformChoice{0, 1, 5}
nodeSnapshotIntervals = uniformChoice{0, 3}
Expand Down
6 changes: 2 additions & 4 deletions test/e2e/networks/ci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ perturb = ["restart"]
[node.validator03]
seeds = ["seed01"]
database = "badgerdb"
abci_protocol = "grpc"
privval_protocol = "unix"
persist_interval = 3
retain_blocks = 3
Expand All @@ -66,22 +65,21 @@ start_at = 1005 # Becomes part of the validator set at 1010
seeds = ["seed02"]
database = "cleveldb"
fast_sync = "v0"
abci_protocol = "grpc"
privval_protocol = "tcp"
perturb = ["kill", "pause", "disconnect", "restart"]

[node.full01]
start_at = 1010
mode = "full"
fast_sync = "v2"
fast_sync = "v0"
persistent_peers = ["validator01", "validator02", "validator03", "validator04", "validator05"]
retain_blocks = 1
perturb = ["restart"]

[node.full02]
start_at = 1015
mode = "full"
fast_sync = "v2"
fast_sync = "v0"
state_sync = true
seeds = ["seed01"]
perturb = ["restart"]