20 |
|
import java.lang.reflect.Constructor; |
21 |
|
import java.lang.reflect.Method; |
22 |
|
import java.lang.reflect.Modifier; |
23 |
+ |
import java.nio.file.Files; |
24 |
+ |
import java.nio.file.Paths; |
25 |
|
import java.security.CodeSource; |
26 |
|
import java.security.Permission; |
27 |
|
import java.security.PermissionCollection; |
54 |
|
import java.util.concurrent.ThreadPoolExecutor; |
55 |
|
import java.util.concurrent.TimeoutException; |
56 |
|
import java.util.concurrent.atomic.AtomicReference; |
57 |
+ |
import java.util.regex.Matcher; |
58 |
|
import java.util.regex.Pattern; |
59 |
|
|
60 |
|
import junit.framework.AssertionFailedError; |
210 |
|
+ lastTestCase + " (" + currentRun + "/" + runsPerTest + ")"); |
211 |
|
System.err.println("availableProcessors=" + |
212 |
|
Runtime.getRuntime().availableProcessors()); |
213 |
+ |
System.err.printf("cpu model = %s%n", cpuModel()); |
214 |
|
dumpTestThreads(); |
215 |
|
// one stack dump is probably enough; more would be spam |
216 |
|
break; |
222 |
|
thread.start(); |
223 |
|
} |
224 |
|
|
225 |
+ |
public static String cpuModel() { |
226 |
+ |
try { |
227 |
+ |
Matcher matcher = Pattern.compile("model name\\s*: (.*)") |
228 |
+ |
.matcher(new String( |
229 |
+ |
Files.readAllBytes(Paths.get("/proc/cpuinfo")), "UTF-8")); |
230 |
+ |
matcher.find(); |
231 |
+ |
return matcher.group(1); |
232 |
+ |
} catch (Exception ex) { return null; } |
233 |
+ |
} |
234 |
+ |
|
235 |
|
public void runBare() throws Throwable { |
236 |
|
currentTestCase = this; |
237 |
|
if (methodFilter == null |