Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminate the process running the IDE if it crashes #1126

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

turkeylurkey
Copy link
Member

@turkeylurkey turkeylurkey commented Nov 21, 2024

Fixes #1122

Fix to detect the process id on Windows. I use kill -1 and kill -9 and sleep 5 in an attempt to avoid the defunct process I've seen in the past.

Log showing how the Windows code works for those not familiar with Windows:

+ '[' 23 -eq 23 ']'
+ [[ MINGW64_NT-10.0-20348 == \M\I\N\G\W\6\4\_\N\T* ]]
+ kill -n 1 1823
+ sleep 5
./src/test/resources/ci/scripts/run.sh: line 195:  1823 Hangup                  ./gradlew runIdeForUiTests -PuseLocal=$USE_LOCAL_PLUGIN --info > remoteServer.log 2>&1
+ kill -n 9 1823
./src/test/resources/ci/scripts/run.sh: line 209: kill: (1823) - No such process
+ sleep 5
+ ps -ef
     UID     PID    PPID  TTY        STIME COMMAND
runnerad    1869    1716 ?        00:08:10 /usr/bin/ps
runnerad    1716       1 ?        23:48:37 /usr/bin/bash

Log from Mac (largely the same as Linux)

+ '[' 23 -eq 23 ']'
+ [[ Darwin == \M\I\N\G\W\6\4\_\N\T* ]]
+ kill -1 9176
+ sleep 5
+ kill -9 9176
./src/test/resources/ci/scripts/run.sh: line 215: kill: (9176) - No such process
+ sleep 5
+ ps -f 9176
  UID   PID  PPID   C STIME   TTY           TIME CMD

Another log from Mac where it appears the kill -1 did not work

+ '[' 23 -eq 23 ']'
+ [[ Darwin == \M\I\N\G\W\6\4\_\N\T* ]]
+ kill -1 9412
+ sleep 5
+ kill -9 9412
+ sleep 5
+ ps -f 9412
  UID   PID  PPID   C STIME   TTY           TIME CMD

Copy link
Contributor

@mrglavas mrglavas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

@@ -576,7 +576,7 @@ public static void copyDirectory(String sourceDirectoryLocation, String destinat
* This searches the output of this JUnit run for SocketTimeoutException which
* has been identified as a fatal error and occurs during the Mac tests.
*/
public static synchronized void detectFatalError() {
public static void detectFatalError() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI to other reviewers. This is a response to my comment from a previous PR where after other changes were made, synchronized is no longer required on this method.

Copy link
Contributor

@vaisakhkannan vaisakhkannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, Thanks @turkeylurkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Mac automated UI test failure: SocketTimeoutException, terminate IDE
3 participants