diff options
| author | Soren Hansen <soren.hansen@rackspace.com> | 2010-10-15 21:49:31 +0200 |
|---|---|---|
| committer | Soren Hansen <soren.hansen@rackspace.com> | 2010-10-15 21:49:31 +0200 |
| commit | a2eec045eec52032ae8a3250120229039529ec53 (patch) | |
| tree | 2303e15ff33be4d597ad90af5a1f2d743102b3e6 | |
| parent | 203628e74ac5a63b6bd9237cf82c6452da01fe5b (diff) | |
| download | nova-a2eec045eec52032ae8a3250120229039529ec53.tar.gz nova-a2eec045eec52032ae8a3250120229039529ec53.tar.xz nova-a2eec045eec52032ae8a3250120229039529ec53.zip | |
Add a greenthread.sleep(0.3) in get_console_output unit test. This is needed because, for eventlet based unit tests, rpc polls, and there's a bit of a race. We need to fix this properly later on.
| -rw-r--r-- | nova/tests/cloud_unittest.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/tests/cloud_unittest.py b/nova/tests/cloud_unittest.py index ff466135d..36ab60290 100644 --- a/nova/tests/cloud_unittest.py +++ b/nova/tests/cloud_unittest.py @@ -26,6 +26,7 @@ import StringIO import tempfile import time +from eventlet import greenthread from twisted.internet import defer import unittest from xml.etree import ElementTree @@ -101,6 +102,9 @@ class CloudTestCase(test.TrialTestCase): instance_id = rv['instancesSet'][0]['instanceId'] output = yield self.cloud.get_console_output(context=self.context, instance_id=[instance_id]) self.assertEquals(b64decode(output['output']), 'FAKE CONSOLE OUTPUT') + # TODO(soren): We need this until we can stop polling in the rpc code + # for unit tests. + greenthread.sleep(0.3) rv = yield self.cloud.terminate_instances(self.context, [instance_id]) |
