aboutsummaryrefslogtreecommitdiff
path: root/test/file_reload_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-09-20 17:28:23 +0100
committerGravatar GitHub <noreply@github.com> 2017-09-20 17:28:23 +0100
commit36c7aa6437ccf574318b838d8dffda8c7e59216b (patch)
tree79f9c5dd168b02b6649456d3457dced88f8a6718 /test/file_reload_test.go
parentcd5879f866641141a241706d0d0a0219e52b7e68 (diff)
downloadcoredns-36c7aa6437ccf574318b838d8dffda8c7e59216b.tar.gz
coredns-36c7aa6437ccf574318b838d8dffda8c7e59216b.tar.zst
coredns-36c7aa6437ccf574318b838d8dffda8c7e59216b.zip
plugin/{file,auto}: drop fsnotify (#1090)
* plugin/{file,auto}: drop fsnotify Reload every minute. This is more deterministic then fsnotify. Also other thing cropped up: sharing zone files between zone; there is only 1 fsnotify event and we need to fan out the reload to all zone files. This is a large rewrite (which could still be done), for now, poll the zone file on disk. Give serial no change a special error type so we can check for this. Improve the logging for reloading: 2017/09/19 07:34:39 [INFO] Successfully reloaded zone "miek.nl." in "db.miek.nl" with serial 128263060 2017/09/19 07:34:45 [INFO] Successfully reloaded zone "miek.nl." in "db.miek.nl" with serial 128263059 2017/09/19 07:34:51 [INFO] Successfully reloaded zone "miek.nl." in "db.miek.nl" with serial 128263060 Fixes #1013 * typo
Diffstat (limited to 'test/file_reload_test.go')
-rw-r--r--test/file_reload_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/file_reload_test.go b/test/file_reload_test.go
index e944faa55..01877f693 100644
--- a/test/file_reload_test.go
+++ b/test/file_reload_test.go
@@ -2,10 +2,10 @@ package test
import (
"io/ioutil"
- "log"
"testing"
"time"
+ "github.com/coredns/coredns/plugin/file"
"github.com/coredns/coredns/plugin/proxy"
"github.com/coredns/coredns/plugin/test"
"github.com/coredns/coredns/request"
@@ -14,8 +14,7 @@ import (
)
func TestZoneReload(t *testing.T) {
- t.Parallel()
- log.SetOutput(ioutil.Discard)
+ file.TickTime = 1 * time.Second
name, rm, err := TempFile(".", exampleOrg)
if err != nil {
@@ -52,7 +51,7 @@ example.net:0 {
// Remove RR from the Apex
ioutil.WriteFile(name, []byte(exampleOrgUpdated), 0644)
- time.Sleep(1 * time.Second) // fsnotify
+ time.Sleep(2 * time.Second) // reload time
resp, err = p.Lookup(state, "example.org.", dns.TypeA)
if err != nil {