executor: update test references

This commit is contained in:
Nick Ethier 2018-12-05 11:07:48 -05:00
parent 02f4b0fac5
commit 57ffece7f8
No known key found for this signature in database
GPG Key ID: 07C1A3ECED90D24A
2 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,7 @@
package executor
import (
"context"
"fmt"
"io/ioutil"
"os"
@ -96,7 +97,7 @@ func TestExecutor_IsolationAndConstraints(t *testing.T) {
require.NoError(err)
require.NotZero(ps.Pid)
state, err := executor.Wait()
state, err := executor.Wait(context.Background())
require.NoError(err)
require.Zero(state.ExitCode)
@ -113,7 +114,7 @@ func TestExecutor_IsolationAndConstraints(t *testing.T) {
actualMemLim := strings.TrimSpace(string(data))
require.Equal(actualMemLim, expectedMemLim)
require.NoError(executor.Shutdown("", 0))
executor.Wait()
executor.Wait(context.Background())
// Check if Nomad has actually removed the cgroups
tu.WaitForResult(func() (bool, error) {
@ -176,7 +177,7 @@ func TestExecutor_ClientCleanup(t *testing.T) {
require.NotZero(ps.Pid)
time.Sleep(500 * time.Millisecond)
require.NoError(executor.Shutdown("SIGINT", 100*time.Millisecond))
executor.Wait()
executor.Wait(context.Background())
outWriter, _ := execCmd.GetWriters()
output := outWriter.(*bufferCloser).String()

View File

@ -2,6 +2,7 @@ package executor
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"os"
@ -110,7 +111,7 @@ func TestExecutor_Start_Wait_Failure_Code(pt *testing.T) {
ps, err := executor.Launch(execCmd)
require.NoError(err)
require.NotZero(ps.Pid)
ps, _ = executor.Wait()
ps, _ = executor.Wait(context.Background())
require.NotZero(ps.ExitCode, "expected exit code to be non zero")
require.NoError(executor.Shutdown("SIGINT", 100*time.Millisecond))
})
@ -134,7 +135,7 @@ func TestExecutor_Start_Wait(pt *testing.T) {
require.NoError(err)
require.NotZero(ps.Pid)
ps, err = executor.Wait()
ps, err = executor.Wait(context.Background())
require.NoError(err)
require.NoError(executor.Shutdown("SIGINT", 100*time.Millisecond))
@ -181,7 +182,7 @@ func TestExecutor_WaitExitSignal(pt *testing.T) {
require.NoError(err)
}()
ps, err = executor.Wait()
ps, err = executor.Wait(context.Background())
require.NoError(err)
require.Equal(ps.Signal, int(syscall.SIGKILL))
})