Thanks go vet!

This commit is contained in:
Michael Schurter
2017-04-19 13:05:41 -07:00
parent a5dcf6bbd9
commit b9ea2765ec
3 changed files with 5 additions and 4 deletions

View File

@@ -96,6 +96,7 @@ func (s *scriptCheck) run() *scriptHandle {
switch execctx.Err() {
case context.Canceled:
// check removed during execution; exit
cancel()
return
case context.DeadlineExceeded:
metrics.IncrCounter([]string{"client", "consul", "script_timeouts"}, 1)

View File

@@ -119,7 +119,7 @@ func TestConsulScript_Exec_Timeout(t *testing.T) {
select {
case update := <-hb.updates:
if update.status != api.HealthCritical {
t.Error("expected %q due to timeout but received %q", api.HealthCritical, update)
t.Errorf("expected %q due to timeout but received %q", api.HealthCritical, update)
}
case <-time.After(3 * time.Second):
t.Fatalf("timed out waiting for script check to exit")
@@ -167,7 +167,7 @@ func TestConsulScript_Exec_TimeoutCritical(t *testing.T) {
select {
case update := <-hb.updates:
if update.status != api.HealthCritical {
t.Error("expected %q due to timeout but received %q", api.HealthCritical, update)
t.Errorf("expected %q due to timeout but received %q", api.HealthCritical, update)
}
if update.output != context.DeadlineExceeded.Error() {
t.Errorf("expected output=%q but found: %q", context.DeadlineExceeded.Error(), update.output)
@@ -214,7 +214,7 @@ func TestConsulScript_Exec_Shutdown(t *testing.T) {
select {
case update := <-hb.updates:
if update.status != api.HealthPassing {
t.Error("expected %q due to timeout but received %q", api.HealthCritical, update)
t.Errorf("expected %q due to timeout but received %q", api.HealthCritical, update)
}
case <-time.After(3 * time.Second):
t.Fatalf("timed out waiting for script check to exit")