e2e: add TERM trap to pod sleep command
This should avoid the 30s delay caused by shell not responding to SIGTERM, and can only be killed by SIGKILL. If the pod is deleted with the namespace during cleanup, this also makes cleanup faster, and frees up the resources for the next test cases faster.
This commit is contained in:
@@ -43,11 +43,11 @@ func NodeOSDistroIs(distro string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
const InfiniteSleepCommand = "trap exit TERM; while true; do sleep 1; done"
|
||||
|
||||
// GenerateScriptCmd generates the corresponding command lines to execute a command.
|
||||
func GenerateScriptCmd(command string) []string {
|
||||
var commands []string
|
||||
commands = []string{"/bin/sh", "-c", command}
|
||||
return commands
|
||||
return []string{"/bin/sh", "-c", command}
|
||||
}
|
||||
|
||||
// GetDefaultTestImage returns the default test image based on OS.
|
||||
|
Reference in New Issue
Block a user