File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -151,10 +151,6 @@ func (c *NamenodeConnection) resolveConnection() error {
151
151
}
152
152
153
153
for _ , host := range c .hostList {
154
- if c .host == host {
155
- continue
156
- }
157
-
158
154
if host .lastErrorAt .After (time .Now ().Add (- backoffDuration )) {
159
155
continue
160
156
}
Original file line number Diff line number Diff line change
1
+ package rpc
2
+
3
+ import (
4
+ "io"
5
+ "testing"
6
+ "time"
7
+
8
+ "github.com/stretchr/testify/assert"
9
+ )
10
+
11
+ func TestNamenodeConnection_resolveConnection (t * testing.T ) {
12
+ conn := getNamenode (t )
13
+ conn .markFailure (io .EOF )
14
+
15
+ assert .Error (t , conn .resolveConnection ())
16
+ conn .host .lastErrorAt = time .Now ().Add (- backoffDuration )
17
+ assert .NoError (t , conn .resolveConnection ())
18
+ cachedNamenode = nil
19
+ }
You can’t perform that action at this time.
0 commit comments