You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by aledsage <gi...@git.apache.org> on 2016/11/15 10:18:53 UTC

[GitHub] brooklyn-server pull request #437: Asserts: use DEFAULT_LONG_TIMEOUT in even...

GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/437

    Asserts: use DEFAULT_LONG_TIMEOUT in eventually()

    And update javadoc to say why. Also makes the timeout configurable
    via `-Dbrooklyn.test.defaultTimeout=1s`.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server tidy-assert-timeouts

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/437.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #437
    
----
commit 7a6cbcc65e0a86fa96f8ffc481098ed9e3a4779e
Author: Aled Sage <al...@gmail.com>
Date:   2016-11-15T09:25:42Z

    Asserts: use DEFAULT_LONG_TIMEOUT in eventually()
    
    And update javadoc to say why. Also makes the timeout configurable
    via `-Dbrooklyn.test.defaultTimeout=1s`.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #437: Asserts: use DEFAULT_LONG_TIMEOUT in even...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/437


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #437: Asserts: use DEFAULT_LONG_TIMEOUT in even...

Posted by neykov <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #437: Asserts: use DEFAULT_LONG_TIMEOUT in eventually(...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-server/pull/437
  
    LGTM, merging.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---