Blame SOURCES/0004-Make-thread-stress-test-more-robust.patch

f9a98e
From c884a17bfaa3f3ff4a802b3de9e06d48c494eb68 Mon Sep 17 00:00:00 2001
f9a98e
From: Jakub Filak <jfilak@redhat.com>
f9a98e
Date: Tue, 5 Nov 2013 14:00:03 +0100
f9a98e
Subject: [PATCH 04/39] Make thread stress test more robust
f9a98e
f9a98e
Related to #21
f9a98e
Related to rhbz#1051483
f9a98e
---
f9a98e
 test/ThreadStressTest.java | 22 +++++++++++++++-------
f9a98e
 1 file changed, 15 insertions(+), 7 deletions(-)
f9a98e
f9a98e
diff --git a/test/ThreadStressTest.java b/test/ThreadStressTest.java
f9a98e
index 3ebf9e0..981ba91 100644
f9a98e
--- a/test/ThreadStressTest.java
f9a98e
+++ b/test/ThreadStressTest.java
f9a98e
@@ -46,22 +46,29 @@ public class ThreadStressTest {
f9a98e
 
f9a98e
         List<Thread> tojoin = new LinkedList<Thread>();
f9a98e
 
f9a98e
-        for (int i = 100; i != 0; --i) {
f9a98e
-            for (int j = 300; j != 0; --j) {
f9a98e
-                Thread t = new ThreadCaughtException();
f9a98e
-                tojoin.add(t);
f9a98e
-                System.out.println("Starting Thread: " + Integer.toString((i * j) + j));
f9a98e
-                t.start();
f9a98e
+        for (int i = 60; i != 0; --i) {
f9a98e
+            for (int j = 600; j != 0; --j) {
f9a98e
+                try {
f9a98e
+                    Thread t = new ThreadCaughtException();
f9a98e
+                    tojoin.add(t);
f9a98e
+                    System.out.println("Starting Thread: " + Integer.toString((i * j) + j));
f9a98e
+                    t.start();
f9a98e
+                }
f9a98e
+                catch(Throwable t) {
f9a98e
+                    System.out.println("Thread start: " + t.toString());
f9a98e
+                    System.exit(1);
f9a98e
+                }
f9a98e
             }
f9a98e
 
f9a98e
             try {
f9a98e
-                Thread.currentThread().sleep(1000);
f9a98e
+                Thread.currentThread().sleep(500);
f9a98e
             }
f9a98e
             catch (InterruptedException ex) {
f9a98e
                 System.out.println("Interrupted");
f9a98e
             }
f9a98e
         }
f9a98e
 
f9a98e
+        System.out.println("All Threads Started");
f9a98e
         for (Thread t : tojoin) {
f9a98e
             try {
f9a98e
                 t.join();
f9a98e
@@ -71,6 +78,7 @@ public class ThreadStressTest {
f9a98e
             }
f9a98e
         }
f9a98e
 
f9a98e
+        System.out.println("All Threads Finished");
f9a98e
         System.exit(0);
f9a98e
     }
f9a98e
 }
f9a98e
-- 
f9a98e
1.8.3.1
f9a98e