Skip to content

Commit 9eb67ff

Browse files
committed
Add test coverage for Slabs
1 parent f60536a commit 9eb67ff

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/client_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,18 @@ func TestStats(t *testing.T) {
626626
if stats.Connections.Accepted < 1 {
627627
t.Errorf("Bad connections: %v", stats.Connections)
628628
}
629+
630+
if val, ok := stats.Slabs[upstream]; ok {
631+
if val.Pages.Used < 1 {
632+
t.Errorf("Slabs pages stats missing: %v", val.Pages)
633+
}
634+
if len(val.Slots) < 1 {
635+
t.Errorf("Slab slots not visible in stats: %v", val.Slots)
636+
}
637+
} else {
638+
t.Errorf("Slab stats for upsteam '%v' not found", upstream)
639+
}
640+
629641
if stats.HTTPRequests.Total < 1 {
630642
t.Errorf("Bad HTTPRequests: %v", stats.HTTPRequests)
631643
}

0 commit comments

Comments
 (0)