def setup_module(): if CASSANDRA_IP.startswith("127.0.0.") and not USE_CASS_EXTERNAL: use_singledc(start=False) ccm_cluster = get_cluster() ccm_cluster.stop() config_options = { 'authenticator': 'PasswordAuthenticator', 'authorizer': 'CassandraAuthorizer' } ccm_cluster.set_configuration_options(config_options) log.debug("Starting ccm test cluster with %s", config_options) start_cluster_wait_for_up(ccm_cluster)
def setup_module(): if CASSANDRA_IP.startswith("127.0.0."): use_singledc(start=False) ccm_cluster = get_cluster() ccm_cluster.stop() config_options = {'authenticator': 'PasswordAuthenticator', 'authorizer': 'CassandraAuthorizer'} ccm_cluster.set_configuration_options(config_options) log.debug("Starting ccm test cluster with %s", config_options) ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True) # there seems to be some race, with some versions of C* taking longer to # get the auth (and default user) setup. Sleep here to give it a chance time.sleep(10) else: set_default_cass_ip()
def test_element_count_validation(self): """ Tests that big collections are detected and raise an exception. """ while True: try: TestSetModel.create(text_set=set(str(uuid4()) for i in range(65535))) break except WriteTimeout: ex_type, ex, tb = sys.exc_info() log.warning("{0}: {1} Backtrace: {2}".format(ex_type.__name__, ex, traceback.extract_tb(tb))) del tb except OperationTimedOut: #This will happen if the host is remote self.assertFalse(CASSANDRA_IP.startswith("127.0.0.")) self.assertRaises(ValidationError, TestSetModel.create, **{'text_set': set(str(uuid4()) for i in range(65536))})
def test_element_count_validation(self): """ Tests that big collections are detected and raise an exception. """ while True: try: TestSetModel.create(text_set=set( str(uuid4()) for i in range(65535))) break except WriteTimeout: ex_type, ex, tb = sys.exc_info() log.warning("{0}: {1} Backtrace: {2}".format( ex_type.__name__, ex, traceback.extract_tb(tb))) del tb except OperationTimedOut: #This will happen if the host is remote self.assertFalse(CASSANDRA_IP.startswith("127.0.0.")) self.assertRaises( ValidationError, TestSetModel.create, **{'text_set': set(str(uuid4()) for i in range(65536))})