Fix scheduler cleanup edge cases
This commit is contained in:
@@ -123,6 +123,29 @@ func TestValidateCheckScheduleChoice(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateNegativeIntervalMessage(t *testing.T) {
|
||||
_, err := Load(writeTmp(t, `
|
||||
agent_id = "host-1"
|
||||
state_dir = "/tmp/x"
|
||||
|
||||
[server]
|
||||
enabled = true
|
||||
url = "http://localhost"
|
||||
|
||||
[[checks]]
|
||||
id = "c1"
|
||||
command = "true"
|
||||
interval = "-1s"
|
||||
timeout = "5s"
|
||||
`))
|
||||
if err == nil {
|
||||
t.Fatal("expected negative interval error")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "interval must not be negative") {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadResourceLimits(t *testing.T) {
|
||||
c, err := Load(writeTmp(t, `
|
||||
agent_id = "host-1"
|
||||
|
||||
Reference in New Issue
Block a user