/hg/icedtea-web: Kill processes in Integration Tests more cleanly
jkang at icedtea.classpath.org
jkang at icedtea.classpath.org
Fri Apr 10 14:58:28 UTC 2015
changeset 348045d8bf85 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=348045d8bf85
author: Jie Kang <jkang at redhat.com>
date: Fri Apr 10 10:53:23 2015 -0400
Kill processes in Integration Tests more cleanly
2015-04-10 Jie Kang <jkang at redhat.com>
Kill processes in Integration Tests more cleanly
* tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java:
use SIGUSR1 instead of SIGINT, don't destroy process after sending signal
* tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java:
reduce timeout from 20 seconds to 10
* tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java:
remove usage of softkiller to close tabs (softkiller no longer works)
diffstat:
ChangeLog | 9 ++
tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java | 41 ++-------
tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java | 2 +-
tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java | 5 -
4 files changed, 22 insertions(+), 35 deletions(-)
diffs (111 lines):
diff -r 8bddbbe7ee7a -r 348045d8bf85 ChangeLog
--- a/ChangeLog Fri Apr 10 13:18:02 2015 +0200
+++ b/ChangeLog Fri Apr 10 10:53:23 2015 -0400
@@ -1,3 +1,12 @@
+2015-04-10 Jie Kang <jkang at redhat.com>
+ Kill processes in Integration Tests more cleanly
+ * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java:
+ use SIGUSR1 instead of SIGINT, don't destroy process after sending signal
+ * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java:
+ reduce timeout from 20 seconds to 10
+ * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java:
+ remove usage of softkiller to close tabs (softkiller no longer works)
+
2015-04-10 Jiri Vanek <jvanek at redhat.com>
ok/apply/cancel mechanism in itweb-settings fixed to work again. Added rest button for cache path.
diff -r 8bddbbe7ee7a -r 348045d8bf85 tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java
--- a/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java Fri Apr 10 13:18:02 2015 +0200
+++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java Fri Apr 10 10:53:23 2015 -0400
@@ -200,17 +200,19 @@
String pid = (f.get(p)).toString();
if (reactingProcess != null) {
reactingProcess.beforeKill(pid);
- };
- sigInt(pid);
- //sigTerm(pid);
- //sigKill(pid);
+ }
+// sigInt(pid);
+// sigTerm(pid);
+// sigKill(pid);
+ sigUsr1(pid);
+
+ p.destroy();
} catch (Exception ex) {
ServerAccess.logException(ex);
} finally {
- p.destroy();
if (reactingProcess != null) {
reactingProcess.afterKill("");
- };
+ }
}
}
@@ -226,6 +228,10 @@
kill(pid, "SIGTERM");
}
+ public static void sigUsr1(String pid) throws Exception {
+ kill(pid, "SIGUSR1");
+ }
+
public static void kill(String pid, String signal) throws InterruptedException, Exception {
List<String> ll = new ArrayList<String>(4);
ll.add("kill");
@@ -240,27 +246,4 @@
void setReactingProcess(ReactingProcess reactingProcess) {
this.reactingProcess = reactingProcess;
}
-
- public static void closeWindow(String pid) throws Exception {
- List<String> ll = new ArrayList<String>(2);
- ll.add(ServerAccess.getInstance().getDir().getParent() + "/softkiller");
- ll.add(pid);
- ServerAccess.executeProcess(ll); //sync, but acctually release
- //before affected application "close"
- Thread.sleep(100);
-
- }
-
- public static void closeWindows(String s) throws Exception {
- closeWindows(s, 10);
- }
-
- public static void closeWindows(String s, int count) throws Exception {
- //each close closes just one tab...
- for (int i = 0; i < count; i++) {
- ProcessAssasin.closeWindow(s);
- }
- }
-
-
}
diff -r 8bddbbe7ee7a -r 348045d8bf85 tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java
--- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java Fri Apr 10 13:18:02 2015 +0200
+++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java Fri Apr 10 10:53:23 2015 -0400
@@ -108,7 +108,7 @@
* timeout in ms to let process to finish, before assassin will kill it.
* This can be changed in runtime, but will affect all following tasks
*/
- public static long PROCESS_TIMEOUT = 20 * 1000;//ms
+ public static long PROCESS_TIMEOUT = 10 * 1000;//ms
/**
* this flag is indicating whether output of executeProcess should be logged. By default true.
*/
diff -r 8bddbbe7ee7a -r 348045d8bf85 tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java
--- a/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java Fri Apr 10 13:18:02 2015 +0200
+++ b/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java Fri Apr 10 10:53:23 2015 -0400
@@ -77,11 +77,6 @@
@Override
public void beforeKill(String s) {
- try {
- ProcessAssasin.closeWindows(s);
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
}
@Override
More information about the distro-pkg-dev
mailing list