[acceptance-tests] Further increase the individual test timeout in the profiler stres...
[mono.git] / acceptance-tests / profiler-stress / runner.cs
index 51c9d91f5e5f0ddbc42c89a85680c8dbe5f751a7..2846c77cb49dc4659af49d4ca9bd49dfa43da574 100644 (file)
@@ -45,26 +45,19 @@ namespace Mono.Profiling.Tests.Stress {
        static class Program {
 
                static readonly string[] _options = new [] {
-                       "domain",
-                       "assembly",
-                       "module",
-                       "class",
-                       "jit",
                        "exception",
-                       "gcalloc",
-                       "gc",
-                       "thread",
-                       // "calls", // Way too heavy.
                        "monitor",
+                       "gc",
+                       "gcalloc",
                        "gcmove",
                        "gcroot",
-                       "context",
+                       "gchandle",
                        "finalization",
                        "counter",
-                       "gchandle",
+                       "jit",
                };
 
-               static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
+               static readonly TimeSpan _timeout = TimeSpan.FromHours (10);
 
                static string FilterInvalidXmlChars (string text) {
                        return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
@@ -95,16 +88,22 @@ namespace Mono.Profiling.Tests.Stress {
                        for (var i = 0; i < benchmarks.Length; i++) {
                                var bench = benchmarks [i];
 
-                               var sampleFreq = rand.Next (0, 1001);
-                               var sampleMode = rand.Next (0, 2) == 1 ? "real" : "process";
+                               var sampleFreq = rand.Next (-1000, 1001);
+                               var sampleMode = rand.Next (0, 2) == 1 ? "-real" : string.Empty;
                                var maxSamples = rand.Next (0, cpus * 2000 + 1);
-                               var heapShotFreq = rand.Next (0, 11);
+                               var heapShotFreq = rand.Next (-10, 11);
                                var maxFrames = rand.Next (0, 33);
                                var options = _options.ToDictionary (x => x, _ => rand.Next (0, 2) == 1)
                                                      .Select (x => (x.Value ? string.Empty : "no") + x.Key)
                                                      .ToArray ();
 
-                               var profOptions = $"sample={sampleFreq},sampling-{sampleMode},maxsamples={maxSamples},heapshot={heapShotFreq}gc,maxframes={maxFrames},{string.Join (",", options)},output=/dev/null";
+                               var profOptions = $"maxframes={maxFrames},{string.Join (",", options)},output=/dev/null";
+
+                               if (sampleFreq > 0)
+                                       profOptions += $",sample{sampleMode}={sampleFreq},maxsamples={maxSamples}";
+
+                               if (heapShotFreq > 0)
+                                       profOptions += $",heapshot={heapShotFreq}gc";
 
                                var info = new ProcessStartInfo {
                                        UseShellExecute = false,