aboutsummaryrefslogtreecommitdiff
path: root/middleware/proxy/upstream_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-04-24 20:37:43 +0100
committerGravatar GitHub <noreply@github.com> 2017-04-24 20:37:43 +0100
commit003b1bf678f6fc1d551fed5184adccde2137e86f (patch)
treef8d3af6f48ef9d73c841095cf3c04649b11a1fac /middleware/proxy/upstream_test.go
parentbfa18470e53c5058237e02b56c97c5d0a2cb47be (diff)
downloadcoredns-003b1bf678f6fc1d551fed5184adccde2137e86f.tar.gz
coredns-003b1bf678f6fc1d551fed5184adccde2137e86f.tar.zst
coredns-003b1bf678f6fc1d551fed5184adccde2137e86f.zip
Fix health race (#645)
* Revert "middleware/proxy: Make Unhealthy a pointer (#615)" This reverts commit acbf522cebdcd53c26d153c1d9267d709ba75f64. * middleware/proxy: add proper locking This add the proper locking around `Unhealthy`.
Diffstat (limited to 'middleware/proxy/upstream_test.go')
-rw-r--r--middleware/proxy/upstream_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/middleware/proxy/upstream_test.go b/middleware/proxy/upstream_test.go
index fbdb0ce4a..587d96994 100644
--- a/middleware/proxy/upstream_test.go
+++ b/middleware/proxy/upstream_test.go
@@ -42,13 +42,13 @@ func TestSelect(t *testing.T) {
FailTimeout: 10 * time.Second,
MaxFails: 1,
}
- *upstream.Hosts[0].Unhealthy = true
- *upstream.Hosts[1].Unhealthy = true
- *upstream.Hosts[2].Unhealthy = true
+ upstream.Hosts[0].Unhealthy = true
+ upstream.Hosts[1].Unhealthy = true
+ upstream.Hosts[2].Unhealthy = true
if h := upstream.Select(); h != nil {
t.Error("Expected select to return nil as all host are down")
}
- *upstream.Hosts[2].Unhealthy = false
+ upstream.Hosts[2].Unhealthy = false
if h := upstream.Select(); h == nil {
t.Error("Expected select to not return nil")
}