aboutsummaryrefslogtreecommitdiff
path: root/plugin/metrics/setup_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2019-05-13 12:26:05 +0100
committerGravatar Yong Tang <yong.tang.github@outlook.com> 2019-05-13 04:26:05 -0700
commit2ef55f805e9f6e86f68721fac832dbcc5e8536c5 (patch)
tree9909174ed4a74183c5a7f03248cdfa2242e9b1f4 /plugin/metrics/setup_test.go
parentc147e203736b16751cc70d694deb326447d6571e (diff)
downloadcoredns-2ef55f805e9f6e86f68721fac832dbcc5e8536c5.tar.gz
coredns-2ef55f805e9f6e86f68721fac832dbcc5e8536c5.tar.zst
coredns-2ef55f805e9f6e86f68721fac832dbcc5e8536c5.zip
plugin/metrics: fix failed reload (#2816)
Fix metrics endpoint on a failed reload, follows the same lines as the previous PRs, see for e.g. 076b8d4f. Test with a Corefile with 2 server blocks and metrics enabled and then introducing a syntax error: ~~~ [ERROR] Restart failed: Corefile:5 - Error during parsing: Unknown directive 'jfkdjk' [ERROR] SIGUSR1: starting with listener file descriptors: Corefile:5 - Error during parsing: Unknown directive 'jfkdjk' ~~~ And then curl-ing the metrics endpoint. See #2659 and as this is the last one. Fixes: #2659 Getting this all right turns out to be tricky, also it's not easy testable which is something I should fix. Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/metrics/setup_test.go')
-rw-r--r--plugin/metrics/setup_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/metrics/setup_test.go b/plugin/metrics/setup_test.go
index 73555427e..43949fdd3 100644
--- a/plugin/metrics/setup_test.go
+++ b/plugin/metrics/setup_test.go
@@ -22,7 +22,7 @@ func TestPrometheusParse(t *testing.T) {
}
for i, test := range tests {
c := caddy.NewTestController("dns", test.input)
- m, err := prometheusParse(c)
+ m, err := parse(c)
if test.shouldErr && err == nil {
t.Errorf("Test %v: Expected error but found nil", i)
continue