<commit_before>import os
import json
import pytest
from symsynd.report import ReportSymbolizer


TEST_PARAMETER = [
('1.4.1', 'release', 'arm64'),
('1.4.1', 'release', 'armv7'),
('1.4.1', 'release', 'x86_64'),
('1.4.1', 'debug', 'arm64'),
('1.4.1', 'debug', 'armv7'),
('1.4.1', 'debug', 'x86_64'),
]


def basename(fn):
    if fn:
        return fn.rsplit('/', 1)[-1]


def _load_dsyms_and_symbolize_stacktrace(filename, version, build, cpu, res_path, driver):
    filename_version = version.replace(' ', '')
    path = os.path.join(res_path, 'ext', version, build, cpu, filename)
    if not os.path.isfile(path):
        pytest.skip("not test file found")
    with open(path) as f:
        report = json.load(f)

    bt = None
    dsym_paths = []
    dsyms_folder = os.path.join(res_path, 'ext', version, build, 'dSYMs')
    for file in os.listdir(dsyms_folder):
        if file.endswith('.dSYM'):
            dsym_paths.append(os.path.join(dsyms_folder, file))

    rep = ReportSymbolizer(driver, dsym_paths, report['debug_meta']['images'])
    exc = report['exception']['values'][0]
    stacktrace = exc['stacktrace']
    meta = {}
    if 'mechanism' in exc:
        if 'posix_signal' in exc['mechanism']:
            meta['signal'] = exc['mechanism']['posix_signal']['signal']
    if 'registers' in stacktrace:
        meta['registers'] = stacktrace['registers']
    bt = rep.symbolize_backtrace(stacktrace['frames'][::-1],
                                 symbolize_inlined=True,
                                 meta=meta)
    return bt, report


def _filter_system_frames(bt):
    new_bt = []
    for frame in bt:
        if any(p in frame['package'] for p in ('CrashProbeiOS', 'CrashLibiOS')) \
           and 'main.m' not in (frame.get('filename') or ''):
            new_bt.append(frame)
    return new_bt


def _test_doCrash_call(bt, index=1):
    assert bt[index]['symbol_name'] == '-[CRLDetailViewController doCrash]'
    assert basename(bt[index]['filename']) == 'CRLDetailViewController.m'
    assert bt[index]['line'] == 53


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_pthread_list_lock_report(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Crash with _pthread_list_lock held.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/01/
    # -[CRLCrashAsyncSafeThread crash] (CRLCrashAsyncSafeThread.m:41)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashAsyncSafeThread crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashAsyncSafeThread.m'
    assert bt[0]['line'] == 41
    _test_doCrash_call(bt)


@pytest.mark.xfail(reason='C++ Exception handling doesn\'t work')
@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_throw_c_pp_exception(res_path, driver, version, build, cpu):
    # http://www.crashprobe.com/ios/02/
    # Fails on every crash reporter
    raise Exception('Fails on every crash reporter')


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_throw_objective_c_exception(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Throw Objective-C exception.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/03/
    # NSGenericException: An uncaught exception! SCREAM.
    # -[CRLCrashObjCException crash] (CRLCrashObjCException.m:41)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashObjCException crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashObjCException.m'
    assert bt[0]['line'] == 41
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_access_a_non_object_as_an_object(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Access a non-object as an object.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/04/
    # -[CRLCrashNSLog crash] (CRLCrashNSLog.m:41)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashNSLog crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashNSLog.m'
    assert bt[0]['line'] == 41
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_crash_inside_objc_msg_send(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Crash inside objc_msgSend().json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    if cpu == 'x86_64':
        pytest.xfail('bad data from kscrash')

    # http://www.crashprobe.com/ios/05/
    # -[CRLCrashObjCMsgSend crash] (CRLCrashObjCMsgSend.m:47)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashObjCMsgSend crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashObjCMsgSend.m'
    assert bt[0]['line'] == 47
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_message_a_released_object(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Message a released object.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    if cpu == 'x86_64':
        pytest.xfail('bad data from kscrash')

    # http://www.crashprobe.com/ios/06/
    # -[CRLCrashReleasedObject crash]_block_invoke (CRLCrashReleasedObject.m:51-53)
    # -[CRLCrashReleasedObject crash] (CRLCrashReleasedObject.m:49)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '__31-[CRLCrashReleasedObject crash]_block_invoke'
    assert basename(bt[0]['filename']) == 'CRLCrashReleasedObject.m'
    assert bt[0]['line'] == cpu == 'arm64' and 51 or 53
    assert bt[1]['symbol_name'] == '-[CRLCrashReleasedObject crash]'
    assert basename(bt[1]['filename']) == 'CRLCrashReleasedObject.m'
    assert bt[1]['line'] == 49
    _test_doCrash_call(bt, 2)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_write_to_a_read_only_page(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Write to a read-only page.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/07/
    # -[CRLCrashROPage crash] (CRLCrashROPage.m:42)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashROPage crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashROPage.m'
    assert bt[0]['line'] == 42
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_execute_a_privileged_instruction(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Execute a privileged instruction.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/08/
    # ARMv7: -[CRLCrashPrivInst crash] (CRLCrashPrivInst.m:42)
    # ARM64: -[CRLCrashPrivInst crash] (CRLCrashPrivInst.m:52)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashPrivInst crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashPrivInst.m'
    assert bt[0]['line'] == cpu == 'arm64' and 52 or 42
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_execute_an_undefined_instruction(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Execute an undefined instruction.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/09/
    # ARMv7: -[CRLCrashUndefInst crash] (CRLCrashUndefInst.m:42)
    # ARM64: -[CRLCrashUndefInst crash] (CRLCrashUndefInst.m:50)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashUndefInst crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashUndefInst.m'
    assert bt[0]['line'] == cpu == 'arm64' and 50 or 42
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_dereference_a_null_pointer(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
    'Dereference a NULL pointer.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/10/
    # -[CRLCrashNULL crash] (CRLCrashNULL.m:37)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashNULL crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashNULL.m'
    assert bt[0]['line'] == 37
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_dereference_a_bad_pointer(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Dereference a bad pointer.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/11/
    # ARMv7: -[CRLCrashGarbage crash] (CRLCrashGarbage.m:48)
    # ARM64: -[CRLCrashGarbage crash] (CRLCrashGarbage.m:52)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashGarbage crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashGarbage.m'
    assert bt[0]['line'] == cpu == 'arm64' and 52 or 48
    # TODO check here we have one more frame on arm64 from kscrash
    _test_doCrash_call(bt, cpu == 'arm64' and 2 or 1)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
@pytest.mark.bad_crashprobe
def test_jump_into_an_nx_page(res_path, driver, version, build, cpu):<commit_msg>Fix wrong line number validation in test<commit_after>import os
import json
import pytest
from symsynd.report import ReportSymbolizer


TEST_PARAMETER = [
('1.4.1', 'release', 'arm64'),
('1.4.1', 'release', 'armv7'),
('1.4.1', 'release', 'x86_64'),
('1.4.1', 'debug', 'arm64'),
('1.4.1', 'debug', 'armv7'),
('1.4.1', 'debug', 'x86_64'),
]


def basename(fn):
    if fn:
        return fn.rsplit('/', 1)[-1]


def _load_dsyms_and_symbolize_stacktrace(filename, version, build, cpu, res_path, driver):
    filename_version = version.replace(' ', '')
    path = os.path.join(res_path, 'ext', version, build, cpu, filename)
    if not os.path.isfile(path):
        pytest.skip("not test file found")
    with open(path) as f:
        report = json.load(f)

    bt = None
    dsym_paths = []
    dsyms_folder = os.path.join(res_path, 'ext', version, build, 'dSYMs')
    for file in os.listdir(dsyms_folder):
        if file.endswith('.dSYM'):
            dsym_paths.append(os.path.join(dsyms_folder, file))

    rep = ReportSymbolizer(driver, dsym_paths, report['debug_meta']['images'])
    exc = report['exception']['values'][0]
    stacktrace = exc['stacktrace']
    meta = {}
    if 'mechanism' in exc:
        if 'posix_signal' in exc['mechanism']:
            meta['signal'] = exc['mechanism']['posix_signal']['signal']
    if 'registers' in stacktrace:
        meta['registers'] = stacktrace['registers']
    bt = rep.symbolize_backtrace(stacktrace['frames'][::-1],
                                 symbolize_inlined=True,
                                 meta=meta)
    return bt, report


def _filter_system_frames(bt):
    new_bt = []
    for frame in bt:
        if any(p in frame['package'] for p in ('CrashProbeiOS', 'CrashLibiOS')) \
           and 'main.m' not in (frame.get('filename') or ''):
            new_bt.append(frame)
    return new_bt


def _test_doCrash_call(bt, index=1):
    assert bt[index]['symbol_name'] == '-[CRLDetailViewController doCrash]'
    assert basename(bt[index]['filename']) == 'CRLDetailViewController.m'
    assert bt[index]['line'] == 53


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_pthread_list_lock_report(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Crash with _pthread_list_lock held.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/01/
    # -[CRLCrashAsyncSafeThread crash] (CRLCrashAsyncSafeThread.m:41)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashAsyncSafeThread crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashAsyncSafeThread.m'
    assert bt[0]['line'] == 41
    _test_doCrash_call(bt)


@pytest.mark.xfail(reason='C++ Exception handling doesn\'t work')
@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_throw_c_pp_exception(res_path, driver, version, build, cpu):
    # http://www.crashprobe.com/ios/02/
    # Fails on every crash reporter
    raise Exception('Fails on every crash reporter')


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_throw_objective_c_exception(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Throw Objective-C exception.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/03/
    # NSGenericException: An uncaught exception! SCREAM.
    # -[CRLCrashObjCException crash] (CRLCrashObjCException.m:41)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashObjCException crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashObjCException.m'
    assert bt[0]['line'] == 41
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_access_a_non_object_as_an_object(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Access a non-object as an object.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/04/
    # -[CRLCrashNSLog crash] (CRLCrashNSLog.m:41)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashNSLog crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashNSLog.m'
    assert bt[0]['line'] == 41
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_crash_inside_objc_msg_send(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Crash inside objc_msgSend().json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    if cpu == 'x86_64':
        pytest.xfail('bad data from kscrash')

    # http://www.crashprobe.com/ios/05/
    # -[CRLCrashObjCMsgSend crash] (CRLCrashObjCMsgSend.m:47)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashObjCMsgSend crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashObjCMsgSend.m'
    assert bt[0]['line'] == 47
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_message_a_released_object(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Message a released object.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    if cpu == 'x86_64':
        pytest.xfail('bad data from kscrash')

    # http://www.crashprobe.com/ios/06/
    # -[CRLCrashReleasedObject crash]_block_invoke (CRLCrashReleasedObject.m:51-53)
    # -[CRLCrashReleasedObject crash] (CRLCrashReleasedObject.m:49)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '__31-[CRLCrashReleasedObject crash]_block_invoke'
    assert basename(bt[0]['filename']) == 'CRLCrashReleasedObject.m'
    assert bt[0]['line'] == (cpu == 'arm64' and 51 or 53)
    assert bt[1]['symbol_name'] == '-[CRLCrashReleasedObject crash]'
    assert basename(bt[1]['filename']) == 'CRLCrashReleasedObject.m'
    assert bt[1]['line'] == 49
    _test_doCrash_call(bt, 2)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_write_to_a_read_only_page(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Write to a read-only page.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/07/
    # -[CRLCrashROPage crash] (CRLCrashROPage.m:42)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashROPage crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashROPage.m'
    assert bt[0]['line'] == 42
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_execute_a_privileged_instruction(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Execute a privileged instruction.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/08/
    # ARMv7: -[CRLCrashPrivInst crash] (CRLCrashPrivInst.m:42)
    # ARM64: -[CRLCrashPrivInst crash] (CRLCrashPrivInst.m:52)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashPrivInst crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashPrivInst.m'
    assert bt[0]['line'] == (cpu == 'arm64' and 52 or 42)
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_execute_an_undefined_instruction(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Execute an undefined instruction.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/09/
    # ARMv7: -[CRLCrashUndefInst crash] (CRLCrashUndefInst.m:42)
    # ARM64: -[CRLCrashUndefInst crash] (CRLCrashUndefInst.m:50)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashUndefInst crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashUndefInst.m'
    assert bt[0]['line'] == (cpu == 'arm64' and 50 or 42)
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_dereference_a_null_pointer(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
    'Dereference a NULL pointer.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/10/
    # -[CRLCrashNULL crash] (CRLCrashNULL.m:37)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashNULL crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashNULL.m'
    assert bt[0]['line'] == 37
    _test_doCrash_call(bt)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
def test_dereference_a_bad_pointer(res_path, driver, version, build, cpu):
    bt, report = _load_dsyms_and_symbolize_stacktrace(
        'Dereference a bad pointer.json',
        version,
        build,
        cpu,
        res_path,
        driver
    )

    # http://www.crashprobe.com/ios/11/
    # ARMv7: -[CRLCrashGarbage crash] (CRLCrashGarbage.m:48)
    # ARM64: -[CRLCrashGarbage crash] (CRLCrashGarbage.m:52)
    # -[CRLDetailViewController doCrash] (CRLDetailViewController.m:53)
    assert bt is not None
    bt = _filter_system_frames(bt)
    assert bt[0]['symbol_name'] == '-[CRLCrashGarbage crash]'
    assert basename(bt[0]['filename']) == 'CRLCrashGarbage.m'
    assert bt[0]['line'] == (cpu == 'arm64' and 52 or 48)
    # TODO check here we have one more frame on arm64 from kscrash
    _test_doCrash_call(bt, cpu == 'arm64' and 2 or 1)


@pytest.mark.parametrize("version, build, cpu", TEST_PARAMETER)
@pytest.mark.bad_crashprobe
def test_jump_into_an_nx_page(res_path, driver, version, build, cpu):
{'fraction_non_alphanumeric': 0.13464801650997477, 'fraction_numerical': 0.0190781930749828, 'mean_word_length': 3.5175056971203644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 22, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2233060', 'n_tokens_mistral': 8005, 'n_tokens_neox': 7746, 'n_words': 1499}