Run all the test in the test batch

def run(self):
        """Run all the test in the test batch
        """

        executed_tests = []
        try:

            active_thread = 0
            start_thread = True
            current_index = 0
            active_thread_by_browser_id = {}

            test_index_by_browser_id = {}
            for browser_id in self.browsers_id:
                test_index_by_browser_id[browser_id] = 0

            self.kill_test_batch_if_necessary()

            while active_thread or start_thread:
                start_thread = False

                self.kill_test_batch_if_necessary()

                for browser_id in self.browsers_id:

                    if active_thread_by_browser_id.get(browser_id) is None:
                        active_thread_by_browser_id[browser_id] = 0
                    else:
                        current_active_thread = 0
                        for thread in threading.enumerate():

                            # Make sure that the thread is TestThread
                            if hasattr(thread, 'test'):
                                if thread.test._browser_config.browser_id == browser_id:  # noqa
                                    current_active_thread += 1

                        active_thread_by_browser_id[browser_id] = current_active_thread  # noqa

                    for j in range(0, len(self.instances[browser_id]) - active_thread_by_browser_id[browser_id]):  # noqa

                        self.kill_test_batch_if_necessary()

                        if test_index_by_browser_id[browser_id] < len(self.tests):  # noqa
                            current_index += 1

                            test = self.tests[test_index_by_browser_id[browser_id]]  # noqa

                            test_index_by_browser_id[browser_id] += 1

                            test_ = test.Test(
                                runner=self,
                                test_batch_id=self.test_batch_id,
                                browser_config=self.browser_configs[browser_id],  # noqa
                                name=test.Test.name,
                                index=test_index_by_browser_id[browser_id]
                            )
                            test_.pdriver.embed_disabled = True

                            thread = TestThread(test_)
                            thread.start()

                            executed_tests.append(test_)

                active_thread = len([tn for tn in threading.enumerate() if type(tn) != threading._MainThread and hasattr(tn, 'test')])  # noqa
                # self.info_log("active_thread=%s" % active_thread)
                if active_thread:
                    try:
                        active_thread_test_number = len([tn for tn in threading.enumerate() if type(tn) != threading._MainThread and hasattr(tn, 'test')])  # noqa
                        self.info_log("Active thread number: %s" % active_thread_test_number)  # noqa
                        self.info_log("Active thread name: %s" % (', '.join([  # noqa
                                "%s-%s" % (
                                    th.test._browser_config.browser_id,
                                    th.test._name
                                ) for th in threading.enumerate() if type(th) != threading._MainThread and hasattr(th, 'test')  # noqa
                            ])
                        ))
                    except Exception as e:
                        self.error_log("print active exception: %s" % str(e))

                # TIMEOUT
                now = utcnow()
                if (self.starting_timestamp - now).total_seconds() >\
                        BROME_CONFIG['grid_runner']['max_running_time']:

                    self.error_log("max_running_time reached... terminating!")
                    raise TestRunnerKilledException()

                self.kill_test_batch_if_necessary()

                sleep(10)

        except TestRunnerKilledException:
            pass

        except Exception:
            tb = traceback.format_exc()
            self.error_log("Run exception: %s" % str(tb))

        self.set_ending_timestamp()

        self.print_test_summary(executed_tests)