Speedup tests
This commit is contained in:
parent
712e3cba11
commit
f68d540491
2 changed files with 8 additions and 2 deletions
|
|
@ -20,7 +20,8 @@ func TestMeters(t *testing.T) {
|
|||
"i/o timeout",
|
||||
"no ping response for 192.0.2.2", // SMA
|
||||
"[1ESY1161052714 1ESY1161229249 1EMH0008842285 1ESY1161978584 1EMH0004864048 1ESY1161979033 7ELS8135823805]", // Discovergy
|
||||
"can only have either uri or device", // modbus
|
||||
"can only have either uri or device", // modbus
|
||||
"(Client.Timeout exceeded while awaiting headers)", // http
|
||||
}
|
||||
|
||||
for _, tmpl := range test.ConfigTemplates("meter") {
|
||||
|
|
|
|||
|
|
@ -98,8 +98,13 @@ func (p *Socket) listen() {
|
|||
headers.Set(k, v)
|
||||
}
|
||||
|
||||
dialer := &websocket.Dialer{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
HandshakeTimeout: request.Timeout,
|
||||
}
|
||||
|
||||
for {
|
||||
client, _, err := websocket.DefaultDialer.Dial(p.url, headers)
|
||||
client, _, err := dialer.Dial(p.url, headers)
|
||||
if err != nil {
|
||||
p.log.ERROR.Println(err)
|
||||
time.Sleep(retryDelay)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue