Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/437#discussion_r88029217
  
    --- Diff: utils/common/src/main/java/org/apache/brooklyn/test/Asserts.java 
---
    @@ -74,17 +74,45 @@
     public class Asserts {
     
         /** 
    -     * Timeout for use when something should happen within several seconds,
    -     * but there might be network calls or computation so {@link 
#DEFAULT_SHORT_TIMEOUT} is not applicable.
    +     * Timeout for use when something should happen. This is the *default 
timeout* that should
    +     * be used by tests (unless that test is asserting performance).
    +     * 
    +     * We willingly accept the hit of slow failing tests, in exchange for 
removing the 
    +     * false-negative failures that have historically littered our jenkins 
builds 
    +     * (which are presumably sometimes run on over-contended or low-spec 
machines).
    +     * 
    +     * If the long timeout is irritates during dev (e.g. when doing TDD, 
where failing tests are 
    +     * an important step), then one can change this value locally or set 
using something like
    +     * {@code -Dbrooklyn.test.defaultTimeout=1s}.
          */
    -    public static final Duration DEFAULT_LONG_TIMEOUT = 
Duration.THIRTY_SECONDS;
    -    
    +    public static final Duration DEFAULT_LONG_TIMEOUT;
    +
    +    static {
    +        String defaultTimeout = 
System.getProperty("brooklyn.test.defaultTimeout");
    +        if (defaultTimeout == null){
    +            DEFAULT_LONG_TIMEOUT = Duration.THIRTY_SECONDS;
    +        } else {
    +            DEFAULT_LONG_TIMEOUT = Duration.of(defaultTimeout);
    +        }
    +    }
    --- End diff --
    
    Good idea.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to