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

    https://github.com/apache/incubator-brooklyn/pull/1174#discussion_r50965837
  
    --- 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
    --- End diff --
    
    I don't think it's that bad right now -- basically it asserts that any 
blocking config which resolves very quickly is valid, and those which don't 
resolve in time don't cause an error.  So understandable it would be sensitive 
to the speed of the environment.
    
    However I can think of two improvements:
    * Dependent configuration / subtasks have a "transitive-no-wait" mode where 
they are not permitted to block or sleep *except* if they are waiting on 
another "transitive-no-wait" task (similar to if they run such sub-tasks in the 
same thread but probably easier to leave the threading as is but somehow 
prevent waits, e.g. in transitive-no-wait mode we interrupt the thread at 
start, and temporarily clearing the thread if it is about to wait on another 
transitive-no-wait task) -- wdyt? /cc @aledsage
    * When `getConfig` returns a coerced value it again asserts the validity of 
that value -- again wdyt @sjcorbett ?



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