harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r517778 - in /harmony/enhanced/drlvm/trunk: build/make/excludes/ vm/tests/smoke/shutdown/
Date Tue, 13 Mar 2007 17:07:13 GMT
Author: gshimansky
Date: Tue Mar 13 10:07:12 2007
New Revision: 517778

URL: http://svn.apache.org/viewvc?view=rev&rev=517778
Log:
Applied HARMONY-3323 [drlvm][smoke tests] Incorrect smoke tests on shutdown


Added:
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.c   (with props)
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.java   (with props)
Removed:
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestNativeAllocation.c
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestNativeAllocation.h
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestNativeAllocation.java
    harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestWaitSet.java
Modified:
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.opt
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.opt
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.opt

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.opt
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.opt?view=diff&rev=517778&r1=517777&r2=517778
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.opt (original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86.opt Tue
Mar 13 10:07:12 2007
@@ -7,6 +7,3 @@
 # breaks on ubuntu 6 w/ OOME
 stress/Threads.java
 stress/Mix.java
-
-# HARMONY-3266
-shutdown/TestNativeAllocation.java

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.opt
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.opt?view=diff&rev=517778&r1=517777&r2=517778
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.opt
(original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.linux.x86_64.opt
Tue Mar 13 10:07:12 2007
@@ -21,8 +21,5 @@
 stress/Stack.java
 stress/Mix.java
 
-# HARMONY-3266
-shutdown/TestNativeAllocation.java
-
 # HARMONY-3299 intermittent
 stress/Sync.java

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.opt
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.opt?view=diff&rev=517778&r1=517777&r2=517778
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.opt (original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.opt Tue
Mar 13 10:07:12 2007
@@ -6,6 +6,3 @@
 io/Integers.java
 
 stress/Mix.java
-
-# HARMONY-3266
-shutdown/TestNativeAllocation.java

Added: harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.c?view=auto&rev=517778
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.c (added)
+++ harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.c Tue Mar 13 10:07:12
2007
@@ -0,0 +1,31 @@
+
+#include "TestDaemonOnWait.h"
+
+/*
+ * Class:     shutdown_TestDaemonOnWait_WorkerThread
+ * Method:    callJNI
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_shutdown_TestDaemonOnWait_00024WorkerThread_callJNI
+  (JNIEnv * jni_env, jobject thread)
+{
+    static int allocated = 0;
+    jclass thread_class;
+    jmethodID methID;
+
+    ++allocated;
+    thread_class = (*jni_env)->GetObjectClass(jni_env, thread);
+    methID = (*jni_env)->GetMethodID(jni_env, thread_class, "calledFromJNI", "()V");
+    if (methID == NULL) {
+        printf("FAILED\n");
+        --allocated;
+        return;
+    }
+
+    (*jni_env)->CallVoidMethod(jni_env, thread, methID);
+    if ((*jni_env)->ExceptionOccurred(jni_env)) {
+        --allocated;
+        return;
+    }
+    printf("FAILED\n");
+}

Propchange: harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.h?view=auto&rev=517778
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.h Tue Mar 13 10:07:12
2007
@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class shutdown_TestDaemonOnWait_WorkerThread */
+
+#ifndef _Included_shutdown_TestDaemonOnWait_WorkerThread
+#define _Included_shutdown_TestDaemonOnWait_WorkerThread
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     shutdown_TestDaemonOnWait_WorkerThread
+ * Method:    callJNI
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_shutdown_TestDaemonOnWait_00024WorkerThread_callJNI
+  (JNIEnv *, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

Propchange: harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.java?view=auto&rev=517778
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.java (added)
+++ harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.java Tue Mar 13
10:07:12 2007
@@ -0,0 +1,61 @@
+package shutdown;
+
+/**
+ * Tests that VM doen't hang on shutdown if a daemon thread is on Object.wait()
+ */
+public class TestDaemonOnWait {
+    private static Object start = new Object();
+    private static Object sync = new Object();
+
+    public static void main(String[] args) {
+        synchronized (start) {
+            try {
+                Thread worker = new WorkerThread();
+                worker.setDaemon(true);
+                worker.start();
+                start.wait();
+            } catch (InterruptedException e) {
+                System.out.println("FAILED");
+            }
+
+            System.out.println("PASSED");
+        }
+    }
+
+    static class WorkerThread extends Thread {
+        private int recursion = 0;
+
+        static {
+            System.loadLibrary("TestDaemonOnWait");
+        }
+
+
+        public native void callJNI();
+
+        public void calledFromJNI() throws InterruptedException {
+            if (recursion < 30) {
+                 ++recursion;
+                 run();
+            }
+
+            // when desired stack frame count is achieved
+            synchronized (sync) {
+                synchronized (start) {
+                    // release main thread in order to initiate VM shutdown
+                    start.notify();
+                }
+
+                // wait here forever.
+                // actually this whait() will be interrupted by VM shutdown
+                // process with the exception.
+                sync.wait();
+            }
+        }
+
+        public void run() {
+            // recursively calls JNI method which calls java method in order
+            // to create a number of M2n and java frames on stack.
+            callJNI();
+        }
+    }
+}

Propchange: harmony/enhanced/drlvm/trunk/vm/tests/smoke/shutdown/TestDaemonOnWait.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message