Fix test_illegal_put failure in plasma test. (#289)

* Fix test_illegal_put failure in plasma test.

* Check that exactly one plasma manager has died.
This commit is contained in:
Robert Nishihara
2017-02-17 11:06:25 -08:00
committed by Stephanie Wang
parent c9bc488ee0
commit 0bbf08a4ac
+8 -3
View File
@@ -747,18 +747,23 @@ class TestPlasmaManager(unittest.TestCase):
j += 1
memory_buffer2[i] = chr(j % 256)
self.client2.seal(object_id)
# Give the second manager some time to complete the seal, then make sure it
# exited.
# Make sure that one of the plasma managers exited (the second one to call
# RAY.OBJECT_TABLE_ADD should have exited). In the vast majority of cases,
# this should be p5. However, on Travis, it is frequently p4.
time_left = 100
while time_left > 0:
if self.p5.poll() != None:
self.processes_to_kill.remove(self.p5)
break
if self.p4.poll() != None:
self.processes_to_kill.remove(self.p4)
break
time_left -= 0.1
time.sleep(0.1)
print("Time waiting for plasma manager to fail = {:.2}".format(100 - time_left))
self.assertNotEqual(self.p5.poll(), None)
# Check that exactly one of the plasma managers has died.
self.assertEqual([self.p5.poll(), self.p4.poll()].count(None), 1)
def test_illegal_functionality(self):
# Create an object id string.