mirror of
https://github.com/wassname/ray.git
synced 2026-07-27 11:26:41 +08:00
Make tests more informative (#372)
* Make tests more informative * Change grpc status checks to warning instead of fatal
This commit is contained in:
committed by
Philipp Moritz
parent
b0ecff69ad
commit
fd353250c8
@@ -6,12 +6,18 @@ import numpy as np
|
||||
|
||||
import test_functions
|
||||
|
||||
class MicroBenchmarkTest(unittest.TestCase):
|
||||
class TestMicroBenchmarks(unittest.TestCase):
|
||||
|
||||
def testTiming(self):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
reload(test_functions)
|
||||
ray.init(start_ray_local=True, num_workers=3)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
ray.worker.cleanup()
|
||||
|
||||
def test_timing(self):
|
||||
# measure the time required to submit a remote task to the scheduler
|
||||
elapsed_times = []
|
||||
for _ in range(1000):
|
||||
@@ -77,7 +83,5 @@ class MicroBenchmarkTest(unittest.TestCase):
|
||||
print " worst: {}".format(elapsed_times[999])
|
||||
# average_elapsed_time should be about 0.00087
|
||||
|
||||
ray.worker.cleanup()
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
unittest.main(verbosity=2)
|
||||
|
||||
Reference in New Issue
Block a user