updated tests

This commit is contained in:
Annika Hannig 2024-01-30 10:52:51 +01:00
parent bac0119f1b
commit d800360ea2
3 changed files with 19 additions and 7 deletions

View File

@ -27,7 +27,10 @@ func TestFindByNeighbors(t *testing.T) {
SourceID: pools.RouteServers.Get("rs1"), SourceID: pools.RouteServers.Get("rs1"),
} }
routes, err := b.FindByNeighbors(ctx, []*api.NeighborQuery{q}) routes, err := b.FindByNeighbors(
ctx,
[]*api.NeighborQuery{q},
api.NewSearchFilters())
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -68,7 +71,7 @@ func TestConcurrentRoutesAccess(t *testing.T) {
for i := 0; i < 200000; i++ { for i := 0; i < 200000; i++ {
wg.Add(1) wg.Add(1)
go func() { go func() {
b.FindByNeighbors(ctx, []*api.NeighborQuery{n1, n2}) b.FindByNeighbors(ctx, []*api.NeighborQuery{n1, n2}, api.NewSearchFilters())
wg.Done() wg.Done()
}() }()
} }

View File

@ -122,7 +122,10 @@ func TestFindByNeighbors(t *testing.T) {
SourceID: pools.RouteServers.Acquire("rs2"), SourceID: pools.RouteServers.Acquire("rs2"),
} }
routes, err := b.FindByNeighbors(ctx, []*api.NeighborQuery{nq1, nq2}) routes, err := b.FindByNeighbors(
ctx,
[]*api.NeighborQuery{nq1, nq2},
api.NewSearchFilters())
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -178,7 +181,7 @@ func TestFindByPrefix(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
routes, err := b.FindByPrefix(ctx, "1.2.") routes, err := b.FindByPrefix(ctx, "1.2.", api.NewSearchFilters(), 0)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -187,6 +190,6 @@ func TestFindByPrefix(t *testing.T) {
t.Error("unexpected routes:", routes) t.Error("unexpected routes:", routes)
} }
routes, _ = b.FindByPrefix(ctx, "5.5.") routes, _ = b.FindByPrefix(ctx, "5.5.", api.NewSearchFilters(), 0)
t.Log(routes) t.Log(routes)
} }

View File

@ -122,7 +122,10 @@ func TestLookupPrefix(t *testing.T) {
store := makeTestRoutesStore() store := makeTestRoutesStore()
query := "193.200." query := "193.200."
results, err := store.LookupPrefix(context.Background(), query) results, err := store.LookupPrefix(
context.Background(),
query,
api.NewSearchFilters())
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -157,7 +160,10 @@ func TestLookupPrefixForNeighbors(t *testing.T) {
store := makeTestRoutesStore() store := makeTestRoutesStore()
// Query // Query
results, err := store.LookupPrefixForNeighbors(context.Background(), neighbors) results, err := store.LookupPrefixForNeighbors(
context.Background(),
neighbors,
api.NewSearchFilters())
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }