2016-03-08 19:07:16 +00:00
|
|
|
package driver
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestDriver_KillTimeout(t *testing.T) {
|
2017-07-21 19:06:39 +00:00
|
|
|
t.Parallel()
|
2016-03-08 19:07:16 +00:00
|
|
|
expected := 1 * time.Second
|
|
|
|
max := 10 * time.Second
|
|
|
|
|
|
|
|
if actual := GetKillTimeout(expected, max); expected != actual {
|
|
|
|
t.Fatalf("GetKillTimeout() returned %v; want %v", actual, expected)
|
|
|
|
}
|
|
|
|
|
|
|
|
expected = 10 * time.Second
|
|
|
|
input := 11 * time.Second
|
|
|
|
|
|
|
|
if actual := GetKillTimeout(input, max); expected != actual {
|
|
|
|
t.Fatalf("KillTimeout() returned %v; want %v", actual, expected)
|
|
|
|
}
|
|
|
|
}
|