executor: update test references
This commit is contained in:
parent
02f4b0fac5
commit
57ffece7f8
|
@ -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()
|
||||
|
|
|
@ -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))
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue