def delete_old_test_runs(expire_age=186, session=None):
    session = session or get_session()
    expire_date = datetime.date.today() - datetime.timedelta(days=expire_age)

    # Delete the test run metadata
    sub_query = session.query(models.TestRun.id).filter(
        models.TestRun.start_time < expire_date).subquery()
    db_utils.model_query(models.TestRunMetadata, session).filter(
        models.TestRunMetadata.test_run_id.in_(sub_query)).delete(
            synchronize_session=False)
    # Delete the test runs
    db_utils.model_query(models.TestRun, session).filter(
        models.TestRun.start_time < expire_date).delete(
            synchronize_session=False)
Test if it lists users that are not on page 1.
dataset/ETHPy150Open openstack-infra/subunit2sql/subunit2sql/db/api.py/delete_old_test_runs--crossover with--dataset/ETHPy150Open Pegase745/sqlalchemy-datatables/tests/test_datatables_legacy.py/DataTablesLegacyTest.test_list_page_x