Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iwysiu committed Nov 7, 2024
1 parent 8d77b55 commit 06e1e2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion backend/proxy/secure_socks_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ func (d *instrumentedSocksDialer) DialContext(ctx context.Context, n, addr strin
log.DefaultLogger.Error("received err from dialer", "network", n, "addr", addr, "err", err)
code = "dial_error"
}
if err != nil {
err = status.DownstreamError(err)
}

secureSocksRequestsDuration.WithLabelValues(code, d.datasourceName, d.datasourceType).Observe(time.Since(start).Seconds())
return c, status.DownstreamError(err)
return c, err
}
2 changes: 1 addition & 1 deletion backend/proxy/secure_socks_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ func TestInstrumentedSocksDialer(t *testing.T) {
c, err := cd.DialContext(context.Background(), "n", "addr")
assert.Nil(t, c)
assert.NotNil(t, err)
assert.Equal(t, "custom error", err.Error())
assert.Equal(t, "downstream error: custom error", err.Error())
})
}

Expand Down

0 comments on commit 06e1e2f

Please sign in to comment.