github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/client/driver/utils_test.go (about)

     1  package driver
     2  
     3  import (
     4  	"testing"
     5  	"time"
     6  )
     7  
     8  func TestDriver_KillTimeout(t *testing.T) {
     9  	t.Parallel()
    10  	expected := 1 * time.Second
    11  	max := 10 * time.Second
    12  
    13  	if actual := GetKillTimeout(expected, max); expected != actual {
    14  		t.Fatalf("GetKillTimeout() returned %v; want %v", actual, expected)
    15  	}
    16  
    17  	expected = 10 * time.Second
    18  	input := 11 * time.Second
    19  
    20  	if actual := GetKillTimeout(input, max); expected != actual {
    21  		t.Fatalf("KillTimeout() returned %v; want %v", actual, expected)
    22  	}
    23  }