@@ -84,7 +84,7 @@ func TestScheduledStopUnix(t *testing.T) {
8484 startMinikube (ctx , t , profile )
8585
8686 // schedule a stop for 5 min from now and make sure PID is created
87- stopMinikube (ctx , t , profile , []string {"--schedule" , "5m" })
87+ stopMinikube (ctx , t , profile , []string {"--schedule" , "5m" , "-v=5" , "--alsologtostderr" })
8888 // make sure timeToStop is present in status
8989 ensureMinikubeScheduledTime (ctx , t , profile , 5 * time .Minute )
9090 pid := checkPID (t , profile )
@@ -93,7 +93,7 @@ func TestScheduledStopUnix(t *testing.T) {
9393 }
9494
9595 // schedule a second stop which should cancel the first scheduled stop
96- stopMinikube (ctx , t , profile , []string {"--schedule" , "15s" })
96+ stopMinikube (ctx , t , profile , []string {"--schedule" , "15s" , "-v=5" , "--alsologtostderr" })
9797 if processRunning (t , pid ) {
9898 t .Fatalf ("process %v running but should have been killed on reschedule of stop" , pid )
9999 }
@@ -109,7 +109,7 @@ func TestScheduledStopUnix(t *testing.T) {
109109 ensureTimeToStopNotPresent (ctx , t , profile )
110110
111111 // schedule another stop, make sure minikube status is "Stopped"
112- stopMinikube (ctx , t , profile , []string {"--schedule" , "15s" })
112+ stopMinikube (ctx , t , profile , []string {"--schedule" , "15s" , "-v=5" , "--alsologtostderr" })
113113 time .Sleep (15 * time .Second )
114114 if processRunning (t , pid ) {
115115 t .Fatalf ("process %v running but should have been killed on reschedule of stop" , pid )
@@ -138,6 +138,9 @@ func stopMinikube(ctx context.Context, t *testing.T, profile string, additionalA
138138 if err != nil {
139139 t .Fatalf ("stopping minikube: %v\n %s" , err , rr .Output ())
140140 }
141+ fmt .Println ("minikube stop output:" )
142+ fmt .Println (rr .Output ())
143+
141144}
142145
143146func checkPID (t * testing.T , profile string ) string {
@@ -167,7 +170,17 @@ func processRunning(t *testing.T, pid string) bool {
167170 }
168171 err = process .Signal (syscall .Signal (0 ))
169172 t .Log ("signal error was: " , err )
170- return err == nil
173+ if err != nil {
174+ return false
175+ }
176+ // then check if this process has become a zombie process
177+ // which is also not running
178+ data , _ := os .ReadFile (fmt .Sprintf ("/proc/%s/status" , pid ))
179+ if strings .Contains (string (data ), "State:\t Z" ) {
180+ t .Logf ("process %s is a zombie" , pid )
181+ return false
182+ }
183+ return true
171184}
172185func ensureMinikubeStatus (ctx context.Context , t * testing.T , profile , key string , wantStatus string ) {
173186 checkStatus := func () error {
0 commit comments