Blame SOURCES/0017-Provide-Arch-specific-StressTest-configuration.patch

b35d98
From 9fb4776f57de0948c5256b3b364880dced66e10d Mon Sep 17 00:00:00 2001
b35d98
From: Jakub Filak <jfilak@redhat.com>
b35d98
Date: Thu, 9 Jan 2014 13:30:14 +0100
b35d98
Subject: [PATCH 17/39] Provide Arch specific StressTest configuration
b35d98
b35d98
Related to rhbz#1054737
b35d98
b35d98
Signed-off-by: Jakub Filak <jfilak@redhat.com>
b35d98
---
b35d98
 test/CMakeLists.txt | 15 ++++++++++++++-
b35d98
 test/testdriver     |  6 ++++--
b35d98
 2 files changed, 18 insertions(+), 3 deletions(-)
b35d98
b35d98
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
b35d98
index 6be9498..0a73e2b 100644
b35d98
--- a/test/CMakeLists.txt
b35d98
+++ b/test/CMakeLists.txt
b35d98
@@ -235,10 +235,23 @@ _add_test_target(
b35d98
 )
b35d98
 _add_test(run_cut_reason_message 2)
b35d98
 
b35d98
+if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^s390x?$")
b35d98
+    set(STRESS_TEST_REPEATS 30)
b35d98
+    set(STRESS_TEST_THREADS 200)
b35d98
+elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^ppc\(64\)?$")
b35d98
+    set(STRESS_TEST_REPEATS 20)
b35d98
+    set(STRESS_TEST_THREADS 150)
b35d98
+elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7l$")
b35d98
+    set(STRESS_TEST_REPEATS 10)
b35d98
+    set(STRESS_TEST_THREADS 100)
b35d98
+else()
b35d98
+    set(STRESS_TEST_REPEATS 60)
b35d98
+    set(STRESS_TEST_THREADS 600)
b35d98
+endif()
b35d98
 
b35d98
 add_custom_target(
b35d98
     run_thread_stress
b35d98
-    COMMAND LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src ${Java_JAVA_EXECUTABLE} -agentlib:${AGENT_NAME}=caught=java.lang.ArrayIndexOutOfBoundsException,journald=no ThreadStressTest
b35d98
+    COMMAND LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/src ${Java_JAVA_EXECUTABLE} -agentlib:${AGENT_NAME}=caught=java.lang.ArrayIndexOutOfBoundsException,journald=no ThreadStressTest reps=${STRESS_TEST_REPEATS} threads=${STRESS_TEST_THREADS}
b35d98
     DEPENDS ${TEST_JAVA_TARGETS}
b35d98
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
b35d98
 )
b35d98
diff --git a/test/testdriver b/test/testdriver
b35d98
index 9e5c2b8..b02bc5c 100644
b35d98
--- a/test/testdriver
b35d98
+++ b/test/testdriver
b35d98
@@ -19,10 +19,12 @@ TMP_RESULT=`mktemp /tmp/abrt_java_connector.XXXXXXX`
b35d98
 
b35d98
 if [ -n "$5" ] && [ 1 -eq $5 ]; then
b35d98
     tac $4 | awk \
b35d98
-'BEGIN             { main = 0 }
b35d98
+'BEGIN             { main = 0; pfx = "" }
b35d98
 /^(Unc|C)aught/    { if (main == 1) { print $0; main = 0 } }
b35d98
                    { if (main == 1) { print $0 } }
b35d98
-/\s*at .*\.main\(/ { if (main == 0) { print $0; main = 1 } }' | tac > $TMP_RESULT
b35d98
+/\s*at .*\.main\(/ { if (main == 0) { print pfx$0; main = 1 } }
b35d98
+                   { pfx = "" }
b35d98
+/^executable:/     { pfx = $0"\n" }' | tac > $TMP_RESULT
b35d98
 else
b35d98
     cp $4 $TMP_RESULT
b35d98
 fi
b35d98
-- 
b35d98
1.8.3.1
b35d98