ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.188 by jsr166, Mon Feb 22 23:16:06 2016 UTC vs.
Revision 1.189 by jsr166, Fri Mar 4 21:00:45 2016 UTC

# Line 184 | Line 184 | public class JSR166TestCase extends Test
184      private static final int suiteRuns =
185          Integer.getInteger("jsr166.suiteRuns", 1);
186  
187 <    private static float systemPropertyValue(String name, float defaultValue) {
187 >    /**
188 >     * Returns the value of the system property, or NaN if not defined.
189 >     */
190 >    private static float systemPropertyValue(String name) {
191          String floatString = System.getProperty(name);
192          if (floatString == null)
193 <            return defaultValue;
193 >            return Float.NaN;
194          try {
195              return Float.parseFloat(floatString);
196          } catch (NumberFormatException ex) {
# Line 199 | Line 202 | public class JSR166TestCase extends Test
202  
203      /**
204       * The scaling factor to apply to standard delays used in tests.
205 +     * May be initialized from any of:
206 +     * - the "jsr166.delay.factor" system property
207 +     * - the "test.timeout.factor" system property (as used by jtreg)
208 +     *   See: http://openjdk.java.net/jtreg/tag-spec.html
209 +     * - hard-coded fuzz factor when using a known slowpoke VM
210       */
211 <    private static final float delayFactor =
204 <        systemPropertyValue("jsr166.delay.factor", 1.0f);
211 >    private static final float delayFactor = delayFactor();
212  
213 <    /**
214 <     * The timeout factor as used in the jtreg test harness.
215 <     * See: http://openjdk.java.net/jtreg/tag-spec.html
216 <     */
217 <    private static final float jtregTestTimeoutFactor
218 <        = systemPropertyValue("test.timeout.factor", 1.0f);
213 >    private static float delayFactor() {
214 >        float x;
215 >        if (!Float.isNaN(x = systemPropertyValue("jsr166.delay.factor")))
216 >            return x;
217 >        if (!Float.isNaN(x = systemPropertyValue("test.timeout.factor")))
218 >            return x;
219 >        String prop = System.getProperty("java.vm.version");
220 >        if (prop != null && prop.matches(".*debug.*"))
221 >            return 4.0f; // How much slower is fastdebug than product?!
222 >        return 1.0f;
223 >    }
224  
225      public JSR166TestCase() { super(); }
226      public JSR166TestCase(String name) { super(name); }
# Line 589 | Line 601 | public class JSR166TestCase extends Test
601       * http://openjdk.java.net/jtreg/command-help.html
602       */
603      protected long getShortDelay() {
604 <        return (long) (50 * delayFactor * jtregTestTimeoutFactor);
604 >        return (long) (50 * delayFactor);
605      }
606  
607      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines