Commit 69d21863 authored by Patrick D. Hunt's avatar Patrick D. Hunt
Browse files

ZOOKEEPER-1799. SaslAuthFailDesignatedClientTest.testAuth fails frequently on...

ZOOKEEPER-1799. SaslAuthFailDesignatedClientTest.testAuth fails frequently on SUSE (Jeffrey Zhong via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.4@1534843 13f79535-47bb-0310-9956-ffa450edef68
parent fff0e83a
......@@ -143,6 +143,9 @@ BUGFIXES:
ZOOKEEPER-1667. Watch event isn't handled correctly when
a client reestablish to a server (jacky007, fpj via fpj)
ZOOKEEPER-1799. SaslAuthFailDesignatedClientTest.testAuth fails
frequently on SUSE (Jeffrey Zhong via phunt)
IMPROVEMENTS:
ZOOKEEPER-1564. Allow JUnit test build with IBM Java
......
......@@ -21,10 +21,12 @@ package org.apache.zookeeper.test;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.TestableZooKeeper;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.Watcher.Event.KeeperState;
......@@ -84,7 +86,14 @@ public class SaslAuthFailDesignatedClientTest extends ClientBase {
@Test
public void testAuth() throws Exception {
ZooKeeper zk = createClient();
// Cannot use createClient here because server may close session before
// JMXEnv.ensureAll is called which will fail the test case
CountdownWatcher watcher = new CountdownWatcher();
TestableZooKeeper zk = new TestableZooKeeper(hostPort, CONNECTION_TIMEOUT, watcher);
if (!watcher.clientConnected.await(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS))
{
Assert.fail("Unable to connect to server");
}
try {
zk.create("/path1", null, Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT);
Assert.fail("Should have gotten exception.");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment