Skip to content

Commit a3cd8fa

Browse files
author
Vighneswar Rao Bojja
committed
Update Test cases
1 parent edb991e commit a3cd8fa

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docker/test.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ server {
1010
}
1111

1212
location /api {
13+
status_zone location_test;
1314
api write=on;
1415
}
1516

1617
location /test {
17-
status_zone location_test;
1818
proxy_pass http://test;
1919
health_check interval=10 fails=3 passes=1;
2020
}

tests/client_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,13 @@ func TestStats(t *testing.T) {
485485
} else {
486486
t.Errorf("Upstream 'test' not found")
487487
}
488-
489-
if locZone, ok := stats.LocationZones[locationZone]; !ok {
490-
t.Errorf("LocationZone %v not found", locZone)
488+
if locZones, ok := stats.LocationZones[locationZone]; ok {
489+
if locZones.Requests < 1 {
490+
t.Errorf("LocationZone stats missing: %v", locZones.Requests)
491+
}
492+
} else {
493+
t.Errorf("LocationZone %v not found", locationZone)
491494
}
492-
493495
if resolver, ok := stats.Resolvers[resolverMetric]; !ok {
494496
t.Errorf("Resolver %v not found", resolver)
495497
}

0 commit comments

Comments
 (0)