brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorbett <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: fix intermittent failing test on ...
Date Wed, 27 Jan 2016 10:05:14 GMT
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1174#discussion_r50962600
  
    --- Diff: brooklyn-server/core/src/test/java/org/apache/brooklyn/core/config/ConfigKeyConstraintTest.java
---
    @@ -297,12 +299,17 @@ public void testContextAwarePredicateInformedOfEntity() {
         public void testQuickFutureResolved() {
             // Result of task is -1, outside of the range specified by the config key.
             try {
    -            app.createAndManageChild(EntitySpec.create(EntityRequiringConfigKeyInRange.class)
    +            EntityRequiringConfigKeyInRange child = app.createAndManageChild(EntitySpec.create(EntityRequiringConfigKeyInRange.class)
                         .configure(EntityRequiringConfigKeyInRange.RANGE, sleepingTask(Duration.ZERO,
-1)));
    -            fail("Expected exception when managing entity with incorrect config");
    +            // may or may not fail above, depending on speed, but should fail if assert
after forcing resolution
    +            Object value = child.getConfig(EntityRequiringConfigKeyInRange.RANGE);
    +            // NB the call above does not currently/necessarily apply validation
    +            log.debug(JavaClassNames.niceClassAndMethod()+" got "+value+" for "+EntityRequiringConfigKeyInRange.RANGE+",
now explicitly validating");
    +            ConfigConstraints.assertValid(child);
    +            fail("Expected exception when managing entity with incorrect config; instead
passed assertion and got: "+value);
             } catch (Exception e) {
    -            Throwable t = Exceptions.getFirstThrowableOfType(e, ConstraintViolationException.class);
    -            assertNotNull(t, "Original exception was: " + Exceptions.collapseText(e));
    +            e.printStackTrace();
    --- End diff --
    
    Did you intend to leave this in place?


---
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.
---

Mime
View raw message