Exemple #1
0
        private static ITestCluster CreateNewNoRetry(int nodeLength, TestClusterOptions options, bool startCluster)
        {
            TryRemove();
            options = options ?? new TestClusterOptions();
            var testCluster = new CcmCluster(
                TestUtils.GetTestClusterNameBasedOnRandomString(),
                IpPrefix,
                DsePath,
                Executor,
                DefaultKeyspaceName,
                IsDse ? DseVersionString : CassandraVersionString);

            testCluster.Create(nodeLength, options);
            if (startCluster)
            {
                if (options.UseVNodes)
                {
                    // workaround for https://issues.apache.org/jira/browse/CASSANDRA-16364
                    foreach (var i in Enumerable.Range(1, nodeLength))
                    {
                        testCluster.Start(i, null, null, options.JvmArgs);
                    }
                }
                else
                {
                    testCluster.Start(options.JvmArgs);
                }
            }
            return(testCluster);
        }
        /// <summary>
        /// Creates a new test cluster
        /// </summary>
        public static ITestCluster CreateNew(int nodeLength = 1, TestClusterOptions options = null, bool startCluster = true)
        {
            TryRemove();
            options = options ?? new TestClusterOptions();
            var testCluster = new CcmCluster(CassandraVersionText, TestUtils.GetTestClusterNameBasedOnTime(), IpPrefix, DefaultKeyspaceName);

            testCluster.Create(nodeLength, options);
            if (startCluster)
            {
                testCluster.Start(options.JvmArgs);
            }
            return(testCluster);
        }
Exemple #3
0
        /// <summary>
        /// Creates a new test cluster
        /// </summary>
        public static ITestCluster CreateNew(int nodeLength = 1, TestClusterOptions options = null, bool startCluster = true)
        {
            TryRemove();
            options = options ?? new TestClusterOptions();
            var testCluster = new CcmCluster(CassandraVersionText, TestUtils.GetTestClusterNameBasedOnTime(), IpPrefix, DefaultKeyspaceName);

            testCluster.Create(nodeLength, options);
            if (startCluster)
            {
                try
                {
                    testCluster.Start(options.JvmArgs);
                }
                catch (TestInfrastructureException) when(nodeLength >= 3 && TestHelper.IsWin)
                {
                    // On Windows, ccm might timeout with 3 or more nodes, give it another chance
                    testCluster.Start(options.JvmArgs);
                }
            }
            LastInstance = testCluster;
            return(testCluster);
        }
Exemple #4
0
        private static ITestCluster CreateNewNoRetry(int nodeLength, TestClusterOptions options, bool startCluster)
        {
            TryRemove();
            options = options ?? new TestClusterOptions();
            var testCluster = new CcmCluster(
                TestUtils.GetTestClusterNameBasedOnRandomString(),
                IpPrefix,
                DsePath,
                Executor,
                DefaultKeyspaceName,
                IsDse ? DseVersionString : CassandraVersionString);

            testCluster.Create(nodeLength, options);
            if (startCluster)
            {
                testCluster.Start(options.JvmArgs);
            }
            return(testCluster);
        }
 /// <summary>
 /// Creates a new test cluster
 /// </summary>
 public static ITestCluster CreateNew(int nodeLength = 1, TestClusterOptions options = null, bool startCluster = true)
 {
     TryRemove();
     options = options ?? new TestClusterOptions();
     var testCluster = new CcmCluster(CassandraVersionText, TestUtils.GetTestClusterNameBasedOnTime(), IpPrefix, DefaultKeyspaceName);
     testCluster.Create(nodeLength, options);
     if (startCluster)
     {
         testCluster.Start(options.JvmArgs);   
     }
     LastInstance = testCluster;
     return testCluster;
 }