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

    https://github.com/apache/incubator-brooklyn/pull/113#discussion_r16538643
  
    --- Diff: 
core/src/test/java/brooklyn/management/ha/HighAvailabilityManagerSplitBrainTest.java
 ---
    @@ -303,31 +305,42 @@ protected void doTestConcurrentStartup(int size, 
final Duration staggerStart) th
                 Thread t = new Thread() { public void run() {
                     if (staggerStart!=null) 
Time.sleep(staggerStart.multiply(Math.random()));
                     n.ha.start(HighAvailabilityMode.AUTO);
    +                n.ha.setPollPeriod(Duration.millis(20));
                 } };
                 spawned.add(t);
                 t.start();
             }
     
    -        
Assert.assertTrue(Repeater.create().every(Duration.millis(1)).limitTimeTo(Duration.THIRTY_SECONDS).until(new
 Callable<Boolean>() {
    -            @Override public Boolean call() throws Exception {
    -                ManagementPlaneSyncRecord memento = 
nodes.get(0).ha.getManagementPlaneSyncState();
    -                int masters=0, standbys=0, savedMasters=0, savedStandbys=0;
    -                for (HaMgmtNode n: nodes) {
    -                    if (n.ha.getNodeState()==ManagementNodeState.MASTER) 
masters++;
    -                    if (n.ha.getNodeState()==ManagementNodeState.STANDBY) 
standbys++;
    -                    ManagementNodeSyncRecord m = 
memento.getManagementNodes().get(n.ownNodeId);
    -                    if (m!=null) {
    -                        if (m.getStatus()==ManagementNodeState.MASTER) 
savedMasters++;
    -                        if (m.getStatus()==ManagementNodeState.STANDBY) 
savedStandbys++;
    +        try {
    +            final Stopwatch timer = Stopwatch.createStarted();
    +            
Assert.assertTrue(Repeater.create().backoff(Duration.millis(1), 1.2, 
Duration.millis(50)).limitTimeTo(Duration.THIRTY_SECONDS).until(new 
Callable<Boolean>() {
    --- End diff --
    
    Why are we using a `Repeater`? Why aren't we just doing 
`Asserts.succeedsEventually`, replacing the return ... with `assertTrue(...)`?
    
    But it was already like that, so not important for this PR.


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