Skip to content

Commit 54add42

Browse files
authored
cmd/geth/tests: try to fix spurious travis failure in les tests (ethereum#21410)
* cmd/geth/tests: try to fix spurious travis failure in les tests * cmd/geth: les_test - remove extraneous option during boot
1 parent 04926db commit 54add42

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cmd/geth/les_test.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ func (g *gethrpc) waitSynced() {
9595
}
9696
}
9797

98-
func startGethWithRpc(t *testing.T, name string, args ...string) *gethrpc {
98+
func startGethWithIpc(t *testing.T, name string, args ...string) *gethrpc {
9999
g := &gethrpc{name: name}
100-
args = append([]string{"--networkid=42", "--port=0", "--nousb", "--http", "--http.port=0", "--http.api=admin,eth,les"}, args...)
100+
args = append([]string{"--networkid=42", "--port=0", "--nousb"}, args...)
101101
t.Logf("Starting %v with rpc: %v", name, args)
102102
g.geth = runGeth(t, args...)
103103
// wait before we can attach to it. TODO: probe for it properly
@@ -112,23 +112,23 @@ func startGethWithRpc(t *testing.T, name string, args ...string) *gethrpc {
112112
}
113113

114114
func initGeth(t *testing.T) string {
115-
g := runGeth(t, "--networkid=42", "init", "./testdata/clique.json")
115+
g := runGeth(t, "--nousb", "--networkid=42", "init", "./testdata/clique.json")
116116
datadir := g.Datadir
117117
g.WaitExit()
118118
return datadir
119119
}
120120

121121
func startLightServer(t *testing.T) *gethrpc {
122122
datadir := initGeth(t)
123-
runGeth(t, "--datadir", datadir, "--password", "./testdata/password.txt", "account", "import", "./testdata/key.prv").WaitExit()
123+
runGeth(t, "--nousb", "--datadir", datadir, "--password", "./testdata/password.txt", "account", "import", "./testdata/key.prv").WaitExit()
124124
account := "0x02f0d131f1f97aef08aec6e3291b957d9efe7105"
125-
server := startGethWithRpc(t, "lightserver", "--allow-insecure-unlock", "--datadir", datadir, "--password", "./testdata/password.txt", "--unlock", account, "--mine", "--light.serve=100", "--light.maxpeers=1", "--nodiscover", "--nat=extip:127.0.0.1")
125+
server := startGethWithIpc(t, "lightserver", "--allow-insecure-unlock", "--datadir", datadir, "--password", "./testdata/password.txt", "--unlock", account, "--mine", "--light.serve=100", "--light.maxpeers=1", "--nodiscover", "--nat=extip:127.0.0.1")
126126
return server
127127
}
128128

129129
func startClient(t *testing.T, name string) *gethrpc {
130130
datadir := initGeth(t)
131-
return startGethWithRpc(t, name, "--datadir", datadir, "--nodiscover", "--syncmode=light", "--nat=extip:127.0.0.1")
131+
return startGethWithIpc(t, name, "--datadir", datadir, "--nodiscover", "--syncmode=light", "--nat=extip:127.0.0.1")
132132
}
133133

134134
func TestPriorityClient(t *testing.T) {
@@ -166,6 +166,7 @@ func TestPriorityClient(t *testing.T) {
166166
freeCli.getNodeInfo().ID: freeCli,
167167
prioCli.getNodeInfo().ID: prioCli,
168168
}
169+
time.Sleep(1 * time.Second)
169170
lightServer.callRPC(&peers, "admin_peers")
170171
peersWithNames := make(map[string]string)
171172
for _, p := range peers {

0 commit comments

Comments
 (0)