server: update tests to use proper AddUpstream API
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7df7f617a791c204ad7e755dac8529e16a6a6964
This commit is contained in:
parent
d0240f30a6
commit
81ccde99d9
2 changed files with 6 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ func TestRouteReuseOnSecondRequest(t *testing.T) {
|
|||
defer db.Close()
|
||||
|
||||
p := prober.New(0.3)
|
||||
p.AddUpstream(upstream.URL, 0)
|
||||
p.RecordLatency(upstream.URL, 10)
|
||||
r := router.New(db, p, time.Hour, 5*time.Second, 10*time.Minute)
|
||||
ts := httptest.NewServer(server.New(r, p, db, []config.UpstreamConfig{{URL: upstream.URL}}, 30))
|
||||
|
|
@ -75,6 +76,8 @@ func TestUpstreamFailoverFallback(t *testing.T) {
|
|||
defer db.Close()
|
||||
|
||||
p := prober.New(0.3)
|
||||
p.AddUpstream(bad.URL, 0)
|
||||
p.AddUpstream(good.URL, 0)
|
||||
p.RecordLatency(bad.URL, 1) // bad appears fastest
|
||||
p.RecordLatency(good.URL, 50)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue