diff options
author | 2019-03-26 14:37:30 +0000 | |
---|---|---|
committer | 2019-03-26 14:37:30 +0000 | |
commit | 53f3f0b666821588e721ceeea4766b76333b668b (patch) | |
tree | e65626cff499082a301ce1579083f021416ec90b /plugin/file/reload_test.go | |
parent | 6492f777cdbaa75f1bdfc90c62a1b2b2e041501c (diff) | |
download | coredns-53f3f0b666821588e721ceeea4766b76333b668b.tar.gz coredns-53f3f0b666821588e721ceeea4766b76333b668b.tar.zst coredns-53f3f0b666821588e721ceeea4766b76333b668b.zip |
Remove context.Context from request.Request (#2726)
* Remove context.Context from request.Request
This removes the context from request.Request and makes all the changes
in the code to make it compile again. It's all mechanical. It did
unearth some weirdness in that the context was kept in handler structs
which may cause havoc with concurrently handling of requests.
Fixes #2721
Signed-off-by: Miek Gieben <miek@miek.nl>
* Make test compile
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/file/reload_test.go')
-rw-r--r-- | plugin/file/reload_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugin/file/reload_test.go b/plugin/file/reload_test.go index 2f7b6cf0f..1139b8a44 100644 --- a/plugin/file/reload_test.go +++ b/plugin/file/reload_test.go @@ -1,6 +1,7 @@ package file import ( + "context" "io/ioutil" "os" "strings" @@ -33,17 +34,18 @@ func TestZoneReload(t *testing.T) { z.Reload() time.Sleep(time.Second) + ctx := context.TODO() r := new(dns.Msg) r.SetQuestion("miek.nl", dns.TypeSOA) state := request.Request{W: &test.ResponseWriter{}, Req: r} - if _, _, _, res := z.Lookup(state, "miek.nl."); res != Success { + if _, _, _, res := z.Lookup(ctx, state, "miek.nl."); res != Success { t.Fatalf("Failed to lookup, got %d", res) } r = new(dns.Msg) r.SetQuestion("miek.nl", dns.TypeNS) state = request.Request{W: &test.ResponseWriter{}, Req: r} - if _, _, _, res := z.Lookup(state, "miek.nl."); res != Success { + if _, _, _, res := z.Lookup(ctx, state, "miek.nl."); res != Success { t.Fatalf("Failed to lookup, got %d", res) } |