2015-07-27 17:21:10 |
Clinton Knight |
description |
As of liberty.2, the Manila unit tests are taking ~60 seconds to run on my system. A dozen or so of the tests consistently take an integral number of seconds to run (i.e. 1, 2, 3 or 4 seconds), indicating the presence of a time.sleep() call in the code that hasn't been mocked. By mocking time.sleep() in just a few files, the time needed to run the unit tests falls by a third to ~40 seconds (!). No test failures were observed after making these changes. |
As of liberty.2, the Manila unit tests are taking ~60 seconds to run on my system. A dozen or so of the tests consistently take an integral number of seconds to run (i.e. 1, 2, 3 or 4 seconds), indicating the presence of a time.sleep() call in the code that hasn't been mocked. By mocking time.sleep() in just a few files, the time needed to run the unit tests falls by a third to ~40 seconds (!). No test failures were observed after making these changes.
Before the changes:
Slowest 10 tests took 19.13 secs:
manila.tests.share.drivers.hds.test_sop.SopShareDriverTestCase
test_wait_for_job_completion_simple 1.01
manila.tests.share.drivers.quobyte.test_jsonrpc.QuobyteJsonRpcTestCase
test_jsonrpc_call_http_exception_retry 3.01
manila.tests.share.drivers.test_generic.GenericShareDriverTestCase
test_attach_volume_attached_retry_correct 2.01
test_attach_volume_failed_attach_1_ManilaException 4.02
test_attach_volume_failed_attach_2_Invalid 4.01
test_wait_for_available_volume 1.01
test_wait_for_available_volume_invalid_1__Mock_id__140081480654736__ 1.01
test_wait_for_available_volume_invalid_2__Mock_id__140081480668304__ 1.01
manila.tests.share.drivers.test_service_instance.ServiceInstanceManagerTestCase
test___create_service_instance_with_sg_success_1_nova 1.01
test___create_service_instance_with_sg_success_2_neutron 1.02
Ran 2930 tests in 57.610s
After the changes:
Slowest 4 tests took 1.28 secs:
manila.tests.api.contrib.test_admin_actions.AdminActionsTest
test_admin_force_delete_share 0.43
manila.tests.share.test_manager.ShareManagerTestCase
test_create_share_from_snapshot_with_server 0.30
test_create_share_with_share_network_server_exists 0.26
test_delete_share_last_on_server_with_sec_services_2_False 0.31
Ran 2930 tests in 38.173s |
|