<commit_before>import os
import subprocess
import time
from distutils import dir_util

from ccmlib import common as ccmcommon

from assertions import assert_one
from dtest import Tester, debug
from tools import known_failure


# WARNING: sstableloader tests should be added to TestSSTableGenerationAndLoading (below),
# and not to BaseSStableLoaderTest (which is shared with upgrade tests)


# Also used by upgrade_tests/storage_engine_upgrade_test
# to test loading legacy sstables
class BaseSStableLoaderTest(Tester):
    __test__ = False
    upgrade_from = None
    compact = False
    jvm_args = None

    def __init__(self, *argv, **kwargs):
        if self.jvm_args is None:
            self.jvm_args = []
        kwargs['cluster_options'] = {'start_rpc': True}
        Tester.__init__(self, *argv, **kwargs)
        self.allow_log_errors = True

    def create_schema(self, session, ks, compression):
        self.create_ks(session, ks, rf=2)
        self.create_cf(session, "standard1", compression=compression, compact_storage=self.compact)
        self.create_cf(session, "counter1", compression=compression, columns={'v': 'counter'},
                       compact_storage=self.compact)

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-11896',
                   flaky=True,
                   notes='windows')
    def sstableloader_compression_none_to_none_test(self):
        self.load_sstable_with_configuration(None, None)

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-12137',
                   flaky=True)
    def sstableloader_compression_none_to_snappy_test(self):
        self.load_sstable_with_configuration(None, 'Snappy')

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-11896',
                   flaky=True,
                   notes='windows')
    def sstableloader_compression_none_to_deflate_test(self):
        self.load_sstable_with_configuration(None, 'Deflate')

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-11896',
                   flaky=True,
                   notes='windows')
    def sstableloader_compression_snappy_to_none_test(self):
        self.load_sstable_with_configuration('Snappy', None)

    def sstableloader_compression_snappy_to_snappy_test(self):
        self.load_sstable_with_configuration('Snappy', 'Snappy')
<commit_msg>add known_failure annotation (#1203)<commit_after>import os
import subprocess
import time
from distutils import dir_util

from ccmlib import common as ccmcommon

from assertions import assert_one
from dtest import Tester, debug
from tools import known_failure


# WARNING: sstableloader tests should be added to TestSSTableGenerationAndLoading (below),
# and not to BaseSStableLoaderTest (which is shared with upgrade tests)


# Also used by upgrade_tests/storage_engine_upgrade_test
# to test loading legacy sstables
class BaseSStableLoaderTest(Tester):
    __test__ = False
    upgrade_from = None
    compact = False
    jvm_args = None

    def __init__(self, *argv, **kwargs):
        if self.jvm_args is None:
            self.jvm_args = []
        kwargs['cluster_options'] = {'start_rpc': True}
        Tester.__init__(self, *argv, **kwargs)
        self.allow_log_errors = True

    def create_schema(self, session, ks, compression):
        self.create_ks(session, ks, rf=2)
        self.create_cf(session, "standard1", compression=compression, compact_storage=self.compact)
        self.create_cf(session, "counter1", compression=compression, columns={'v': 'counter'},
                       compact_storage=self.compact)

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-11896',
                   flaky=True,
                   notes='windows')
    def sstableloader_compression_none_to_none_test(self):
        self.load_sstable_with_configuration(None, None)

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-12137',
                   flaky=True)
    def sstableloader_compression_none_to_snappy_test(self):
        self.load_sstable_with_configuration(None, 'Snappy')

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-11896',
                   flaky=True,
                   notes='windows')
    def sstableloader_compression_none_to_deflate_test(self):
        self.load_sstable_with_configuration(None, 'Deflate')

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-11896',
                   flaky=True,
                   notes='windows')
    def sstableloader_compression_snappy_to_none_test(self):
        self.load_sstable_with_configuration('Snappy', None)

    @known_failure(failure_source='test',
                   jira_url='https://issues.apache.org/jira/browse/CASSANDRA-12137',
                   flaky=True)
    def sstableloader_compression_snappy_to_snappy_test(self):
        self.load_sstable_with_configuration('Snappy', 'Snappy')

{'fraction_non_alphanumeric': 0.09482596425211665, 'fraction_numerical': 0.010348071495766699, 'mean_word_length': 3.1694117647058824, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4650341', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1583, 'n_words': 280}