tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From poornachandra <...@git.apache.org>
Subject [GitHub] incubator-tephra pull request #2: TEPHRA-179 Create a new instance of Transa...
Date Wed, 07 Sep 2016 21:20:55 GMT
Github user poornachandra commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/2#discussion_r77906210
  
    --- Diff: tephra-core/src/test/java/org/apache/tephra/distributed/ThriftTransactionServerTest.java
---
    @@ -188,21 +224,35 @@ public void process(WatchedEvent event) {
         };
     
         // Create another Zookeeper session with the same sessionId so that the original
one expires.
    -    final ZooKeeper dupZookeeper =
    +    ZooKeeper dupZookeeper =
           new ZooKeeper(zkClientService.getConnectString(), zooKeeper.getSessionTimeout(),
watcher,
                         zooKeeper.getSessionId(), zooKeeper.getSessionPasswd());
         connectFuture.get(30, TimeUnit.SECONDS);
         Assert.assertEquals("Failed to re-create current session", dupZookeeper.getState(),
ZooKeeper.States.CONNECTED);
         dupZookeeper.close();
       }
     
    -  private void waitForThriftTermination() throws InterruptedException {
    -    int count = 0;
    -    while (txService.thriftRPCServerState() != Service.State.TERMINATED && count++
< 200) {
    +  private void waitFor(String errorMessage, Callable<Boolean> callable) throws
Exception {
    +    for (int i = 0; i < 200; i++) {
    +      boolean value = callable.call();
    +      if (value) {
    +        return;
    +      }
           TimeUnit.MILLISECONDS.sleep(50);
         }
    +    Assert.fail(errorMessage);
    +  }
    +
    +  private void waitForThriftStatus() throws Exception {
    --- End diff --
    
    Rename to `waitForThriftStop` for clarity?


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