Fix TestRktDriver_PortsMapping and TestAgent_LoadKeyrings

This commit is contained in:
Alex Dadgar 2016-11-15 15:49:05 -08:00
parent 6a4efbf3b2
commit cb187ffce6
2 changed files with 12 additions and 5 deletions

View File

@ -445,13 +445,16 @@ func TestRktDriver_PortsMapping(t *testing.T) {
if handle == nil {
t.Fatalf("missing handle")
}
defer handle.Kill()
go func() {
time.Sleep(1 * time.Second)
if err := handle.Kill(); err != nil {
t.Fatalf("Failed to kill handle: %v", err)
}
}()
select {
case res := <-handle.WaitCh():
if !res.Successful() {
t.Fatalf("err: %v", res)
}
case <-handle.WaitCh():
case <-time.After(time.Duration(testutil.TestMultiplier()*15) * time.Second):
t.Fatalf("timeout")
}

View File

@ -43,6 +43,10 @@ func makeAgent(t testing.TB, cb func(*Config)) (string, *Agent) {
config := nomad.DefaultConfig()
conf.NomadConfig = config
// Set the data_dir
conf.DataDir = dir
conf.NomadConfig.DataDir = dir
// Bind and set ports
conf.BindAddr = "127.0.0.1"
conf.Ports = &Ports{