예제 #1
0
 /// <summary>Test specific setup</summary>
 public static void SetupTestEnv()
 {
     // during the tests we run with 100K prealloc in the logs.
     // on windows systems prealloc of 64M was seen to take ~15seconds
     // resulting in test Assert.failure (client timeout on first session).
     // set env and directly in order to handle static init/gc issues
     Runtime.SetProperty("zookeeper.preAllocSize", "100");
     FileTxnLog.SetPreallocSize(100 * 1024);
 }
예제 #2
0
        public virtual void SetUp()
        {
            Runtime.SetProperty("zookeeper.preAllocSize", "100");
            FileTxnLog.SetPreallocSize(100 * 1024);
            if (!Basetest.Exists())
            {
                Basetest.Mkdirs();
            }
            FilePath dataDir = CreateTmpDir(Basetest);

            zks = new ZooKeeperServer(dataDir, dataDir, 3000);
            int Port = System.Convert.ToInt32(hostPort.Split(":")[1]);

            if (factory == null)
            {
                factory = new NIOServerCnxnFactory();
                factory.Configure(new IPEndPoint(Port), maxCnxns);
            }
            factory.Startup(zks);
            NUnit.Framework.Assert.IsTrue("waiting for server up", WaitForServerUp("127.0.0.1:"
                                                                                   + Port, ConnectionTimeout));
        }