Esempio n. 1
0
    def test_failover(self):

        test_thread = CloudTestThread(self.zk)
        test_thread.start()

        time.sleep(2)

        test_utils.stop_solr(8993)
        test_utils.wait_for_down(self.zk, "localhost:8993_solr")

        time.sleep(2)

        test_utils.start_solr("cloud-node0", 8993)
        test_utils.wait_for_up(self.zk, "core0", "http://localhost:8993/solr")

        test_utils.wait_for_leader(self.zk, "core0")

        test_utils.stop_solr(8994)
        test_utils.wait_for_down(self.zk, "localhost:8994_solr")

        time.sleep(2)

        test_utils.start_solr("cloud-node1", 8994)
        test_utils.wait_for_up(self.zk, "core0", "http://localhost:8994/solr")
        test_utils.wait_for_leader(self.zk, "core0")
        time.sleep(2)

        success, timeouts, exceptions = test_thread.stop()

        self.assertEqual(timeouts, 0)
        self.assertEqual(exceptions, 0)
        self.assertGreater(success, 0)
Esempio n. 2
0
def main():
    test_utils.prepare()
    test_utils.start_solr()

    try:
        unittest.main(module='tests', verbosity=1)
    finally:
        print('Tests complete; halting Solr servers…')
        test_utils.stop_solr()
Esempio n. 3
0
def main():
    test_utils.prepare()
    test_utils.start_solr()

    try:
        unittest.main(module='tests', verbosity=1)
    finally:
        print('Tests complete; halting Solr servers…')
        test_utils.stop_solr()
Esempio n. 4
0
def main():
    if os.environ.has_key("PYSOLR_STARTER"):
        test_utils.set_script(os.environ["PYSOLR_STARTER"])
    else:
        test_utils.set_script("./start-solr-test-server.sh")

    test_utils.prepare()
    test_utils.start_solr()

    try:
        unittest.main(module='tests', verbosity=1)
    finally:
        print('Tests complete; halting Solr servers…')
        test_utils.stop_solr()
Esempio n. 5
0
def main():
    if os.environ.has_key("PYSOLR_STARTER"):
        test_utils.set_script(os.environ["PYSOLR_STARTER"])
    else:
        test_utils.set_script("./start-solr-test-server.sh")

    test_utils.prepare()
    test_utils.start_solr()

    try:
        unittest.main(module='tests', verbosity=1)
    finally:
        print('Tests complete; halting Solr servers…')
        test_utils.stop_solr()
def main():
    faulthandler.register(signal.SIGUSR1, all_threads=True)
    print(
        "Installed SIGUSR1 handler to print stack traces: pkill -USR1 -f run-tests"
    )

    test_utils.prepare()
    test_utils.start_solr()

    try:
        unittest.main(module="tests", verbosity=1)
    finally:
        print("Tests complete; halting Solr servers…")
        test_utils.stop_solr()
Esempio n. 7
0
def main():
    try:
        import faulthandler
        faulthandler.register(signal.SIGUSR1, all_threads=True)
        print('Installed SIGUSR1 handler to print stack traces: pkill -USR1 -f run-tests')
    except ImportError:
        pass

    test_utils.prepare()
    test_utils.start_solr()

    try:
        unittest.main(module='tests', verbosity=1)
    finally:
        print('Tests complete; halting Solr servers…')
        test_utils.stop_solr()
Esempio n. 8
0
def main():
    try:
        import faulthandler
        faulthandler.register(signal.SIGUSR1, all_threads=True)
        print(
            'Installed SIGUSR1 handler to print stack traces: pkill -USR1 -f run-tests'
        )
    except ImportError:
        pass

    test_utils.prepare()
    test_utils.start_solr()

    try:
        unittest.main(module='tests', verbosity=1)
    finally:
        print('Tests complete; halting Solr servers…')
        test_utils.stop_solr()
Esempio n. 9
0
    def test_zk_failure(self):
        return

        test_thread = CloudTestThread(self.zk)
        test_thread.start()

        time.sleep(2)

        self.assertEqual(test_thread.exceptions, 0)

        test_utils.stop_solr(8992)
        test_utils.wait_for_down(self.zk, "localhost:8992_solr")
        time.sleep(2)

        test_utils.start_solr("cloud-node0", 8992)
        test_utils.wait_for_up(self.zk, None, "localhost:8992_solr")
        time.sleep(2)

        success, timeouts, exceptions = test_thread.stop()

        self.assertEqual(timeouts, 0)
        self.assertEqual(exceptions, 0)
        self.assertGreater(success, 0)