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:
@@ -178,7 +178,7 @@ func (o replicaSetsByCreationTimestamp) Less(i, j int) bool {
|
||||
// name. A slice of BASH commands can be supplied as args to be run by the pod
|
||||
func testDeployment(replicas int32, podLabels map[string]string, nodeSelector map[string]string, namespace string, pvclaims []*v1.PersistentVolumeClaim, securityLevel admissionapi.Level, command string) *appsv1.Deployment {
|
||||
if len(command) == 0 {
|
||||
command = "trap exit TERM; while true; do sleep 1; done"
|
||||
command = e2epod.InfiniteSleepCommand
|
||||
}
|
||||
zero := int64(0)
|
||||
deploymentName := "deployment-" + string(uuid.NewUUID())
|
||||
|
||||
Reference in New Issue
Block a user