JDWP: remove thread-related tests for Count modifier

These tests are flaky because other (internal) threads can start/end
in the middle of the test causing its failure. Since we can't ensure
no other thread will start/end in the middle of the test, it's better
to remove them to avoid random failures.

Bug: 18768319

(cherry picked from commit 16838423f26e4799e23f606b37562ef6818b5c46)

Change-Id: I513b13487fc7e89676e9e4ec3e17e7519f7bb205
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierDebuggee.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierDebuggee.java
index 5ea9087..89ab4b0 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierDebuggee.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierDebuggee.java
@@ -27,7 +27,6 @@
 public class CountModifierDebuggee extends SyncDebuggee {
     static int locationEventCount = 0;
     static int exceptionEventCount = 0;
-    static int threadRunCount = 0;
     static int fieldReadWriteCount = 0;
 
     static int watchedField = 0;
@@ -62,18 +61,6 @@
         }
     }
 
-    void runThread() {
-        ++threadRunCount;
-        System.out.println("CountModifierDebuggee.startThread: threadRunCount=" + threadRunCount);
-        Thread t = new Thread("TestThread-" + threadRunCount);
-        t.start();
-        try {
-            t.join();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-    }
-
     void readAndWriteField() {
         ++fieldReadWriteCount;
         System.out.println("CountModifierDebuggee.readAndWriteField: fieldReadWriteCount=" + fieldReadWriteCount);
@@ -102,11 +89,6 @@
             catchException(obj);
         }
 
-        threadRunCount = 0;
-        for (int i = 0; i < EVENT_COUNT; ++i) {
-            runThread();
-        }
-
         fieldReadWriteCount = 0;
         for (int i = 0; i < EVENT_COUNT; ++i) {
             readAndWriteField();
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierTest.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierTest.java
index b70f02a..3a3938e 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierTest.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/jdwp/EventModifiers/CountModifierTest.java
@@ -169,46 +169,6 @@
     }
 
     /**
-     * This testcase is for THREAD_START event with Count modifier.
-     * <BR>It runs CountModifierDebuggee and requests THREAD_START event.
-     * <BR>Then calls {@link CountModifierDebuggee#runThread()}
-     * method multiple times and verifies that requested THREAD_START event
-     * occurs once after having called the method (count - 1) times. We check
-     * this by looking at the value in the field
-     * {@link CountModifierDebuggee#threadRunCount}.
-     */
-    public void testThreadStart() {
-        logWriter.println("testThreadStart started");
-
-        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
-
-        EventBuilder builder = createThreadStartBuilder();
-        testEventWithCountModifier(builder, THREAD_RUN_COUNT_FIELD_NAME);
-
-        logWriter.println("testThreadStart done");
-    }
-
-    /**
-     * This testcase is for THREAD_END event with Count modifier.
-     * <BR>It runs CountModifierDebuggee and requests THREAD_END event.
-     * <BR>Then calls {@link CountModifierDebuggee#runThread()}
-     * method multiple times and verifies that requested THREAD_END event
-     * occurs once after having called the method (count - 1) times. We check
-     * this by looking at the value in the field
-     * {@link CountModifierDebuggee#threadRunCount}.
-     */
-    public void testThreadEnd() {
-        logWriter.println("testThreadEnd started");
-
-        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
-
-        EventBuilder builder = createThreadEndBuilder();
-        testEventWithCountModifier(builder, THREAD_RUN_COUNT_FIELD_NAME);
-
-        logWriter.println("testThreadEnd done");
-    }
-
-    /**
      * This testcase is for FIELD_ACCESS event with Count modifier.
      * <BR>It runs CountModifierDebuggee and requests FIELD_ACCESS event for
      * {@link CountModifierDebuggee#watchedField}.