server: check errors in TestNARRoutingUsesCache
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9a4688c88fbb602cd46cbda819024e4c6a6a6964
This commit is contained in:
parent
118eda08a1
commit
049e4202dd
1 changed files with 8 additions and 3 deletions
|
|
@ -309,16 +309,21 @@ func TestNARRoutingUsesCache(t *testing.T) {
|
||||||
}))
|
}))
|
||||||
defer upstreamB.Close()
|
defer upstreamB.Close()
|
||||||
|
|
||||||
db, _ := cache.Open(":memory:", 100)
|
db, err := cache.Open(":memory:", 100)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
defer db.Close()
|
defer db.Close()
|
||||||
|
|
||||||
// Pre-seed the route cache: abc123 → upstreamA, NarURL = "nar/abc123.nar.xz"
|
// Pre-seed the route cache: abc123 → upstreamA, NarURL = "nar/abc123.nar.xz"
|
||||||
_ = db.SetRoute(&cache.RouteEntry{
|
if err := db.SetRoute(&cache.RouteEntry{
|
||||||
StorePath: "abc123",
|
StorePath: "abc123",
|
||||||
UpstreamURL: upstreamA.URL,
|
UpstreamURL: upstreamA.URL,
|
||||||
NarURL: "nar/abc123.nar.xz",
|
NarURL: "nar/abc123.nar.xz",
|
||||||
TTL: time.Now().Add(time.Hour),
|
TTL: time.Now().Add(time.Hour),
|
||||||
})
|
}); err != nil {
|
||||||
|
t.Fatalf("SetRoute: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
p := prober.New(0.3)
|
p := prober.New(0.3)
|
||||||
p.InitUpstreams([]config.UpstreamConfig{{URL: upstreamA.URL}, {URL: upstreamB.URL}})
|
p.InitUpstreams([]config.UpstreamConfig{{URL: upstreamA.URL}, {URL: upstreamB.URL}})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue