File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ server {
10
10
}
11
11
12
12
location /api {
13
+ status_zone location_test;
13
14
api write=on;
14
15
}
15
16
16
17
location /test {
17
- status_zone location_test;
18
18
proxy_pass http://test;
19
19
health_check interval=10 fails=3 passes=1;
20
20
}
Original file line number Diff line number Diff line change @@ -485,11 +485,13 @@ func TestStats(t *testing.T) {
485
485
} else {
486
486
t .Errorf ("Upstream 'test' not found" )
487
487
}
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 )
491
494
}
492
-
493
495
if resolver , ok := stats .Resolvers [resolverMetric ]; ! ok {
494
496
t .Errorf ("Resolver %v not found" , resolver )
495
497
}
You can’t perform that action at this time.
0 commit comments