<commit_before>import os
import sys
import time
import unittest
import multiprocessing

import percy
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

TIMEOUT = 20


class SeleniumDriverTimeout(Exception):
    pass


class IntegrationTests(unittest.TestCase):

    last_timestamp = 0

    @classmethod
    def setUpClass(cls):
        super(IntegrationTests, cls).setUpClass()

        options = Options()
        capabilities = DesiredCapabilities.CHROME
        capabilities['loggingPrefs'] = {'browser': 'SEVERE'}

        if 'DASH_TEST_CHROMEPATH' in os.environ:
            options.binary_location = os.environ['DASH_TEST_CHROMEPATH']

        cls.driver = webdriver.Chrome(
            options=options, desired_capabilities=capabilities)

        cls.percy_runner = percy.Runner(
            loader=percy.ResourceLoader(
                webdriver=cls.driver,
                base_url='/assets', root_dir='tests/integration/assets'))

        cls.percy_runner.initialize_build()

    @classmethod
    def tearDownClass(cls):
        super(IntegrationTests, cls).tearDownClass()
        cls.driver.quit()
        cls.percy_runner.finalize_build()

    def setUp(self):
        self.server_process = None

    def tearDown(self):
        try:
            time.sleep(1)
            self.server_process.terminate()
            time.sleep(1.5)
        except AttributeError:
            pass
        finally:
            self.clear_log()
            time.sleep(1)

    def startServer(self, dash, **kwargs):
        def run():
            dash.scripts.config.serve_locally = True
            dash.css.config.serve_locally = True
            kws = dict(
                port=8050,
                debug=False,
                processes=4,
                threaded=False
            )
            kws.update(kwargs)
            dash.run_server(**kws)

        # Run on a separate process so that it doesn't block
        self.server_process = multiprocessing.Process(target=run)
        self.server_process.start()<commit_msg>try with more time for ci<commit_after>import os
import sys
import time
import unittest
import multiprocessing

import percy
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

TIMEOUT = 20


class SeleniumDriverTimeout(Exception):
    pass


class IntegrationTests(unittest.TestCase):

    last_timestamp = 0

    @classmethod
    def setUpClass(cls):
        super(IntegrationTests, cls).setUpClass()

        options = Options()
        capabilities = DesiredCapabilities.CHROME
        capabilities['loggingPrefs'] = {'browser': 'SEVERE'}

        if 'DASH_TEST_CHROMEPATH' in os.environ:
            options.binary_location = os.environ['DASH_TEST_CHROMEPATH']

        cls.driver = webdriver.Chrome(
            options=options, desired_capabilities=capabilities)

        cls.percy_runner = percy.Runner(
            loader=percy.ResourceLoader(
                webdriver=cls.driver,
                base_url='/assets', root_dir='tests/integration/assets'))

        cls.percy_runner.initialize_build()

    @classmethod
    def tearDownClass(cls):
        super(IntegrationTests, cls).tearDownClass()
        cls.driver.quit()
        cls.percy_runner.finalize_build()

    def setUp(self):
        self.server_process = None

    def tearDown(self):
        try:
            time.sleep(2)
            self.server_process.terminate()
            time.sleep(2)
        except AttributeError:
            pass
        finally:
            self.clear_log()
            time.sleep(1)

    def startServer(self, dash, **kwargs):
        def run():
            dash.scripts.config.serve_locally = True
            dash.css.config.serve_locally = True
            kws = dict(
                port=8050,
                debug=False,
                processes=4,
                threaded=False
            )
            kws.update(kwargs)
            dash.run_server(**kws)

        # Run on a separate process so that it doesn't block
        self.server_process = multiprocessing.Process(target=run)
        self.server_process.start()
{'fraction_non_alphanumeric': 0.08293633607622347, 'fraction_numerical': 0.00498051104374188, 'mean_word_length': 2.3739956172388603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2872954', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1263, 'n_words': 264}