mirror of
https://github.com/wassname/ray.git
synced 2026-08-12 12:20:11 +08:00
Add a nicer warning message when you pass the wrong thing to ray.wait() (#1239)
* add warnings * fix python mode * Small changes and add tests. * Fix test failure.
This commit is contained in:
committed by
Robert Nishihara
parent
c1496b8111
commit
37831ae0c3
@@ -749,6 +749,15 @@ class APITest(unittest.TestCase):
|
||||
self.assertEqual(ready_ids, [])
|
||||
self.assertEqual(remaining_ids, [])
|
||||
|
||||
# Verify that incorrect usage raises a TypeError.
|
||||
x = ray.put(1)
|
||||
with self.assertRaises(TypeError):
|
||||
ray.wait(x)
|
||||
with self.assertRaises(TypeError):
|
||||
ray.wait(1)
|
||||
with self.assertRaises(TypeError):
|
||||
ray.wait([1])
|
||||
|
||||
def testMultipleWaitsAndGets(self):
|
||||
# It is important to use three workers here, so that the three tasks
|
||||
# launched in this experiment can run at the same time.
|
||||
|
||||
Reference in New Issue
Block a user